set -utf-8 flag only for real MSVC compilers. E.g. not Intel's icx.exe

This commit is contained in:
Axel Kohlmeyer 2022-05-18 15:51:33 -04:00
parent 8d51dc50eb
commit 6f3f9a9e61

View File

@ -82,7 +82,9 @@ macro(config_compiler_and_linker)
# http://stackoverflow.com/questions/3232669 explains the issue. # http://stackoverflow.com/questions/3232669 explains the issue.
set(cxx_base_flags "${cxx_base_flags} -wd4702") set(cxx_base_flags "${cxx_base_flags} -wd4702")
# Ensure MSVC treats source files as UTF-8 encoded. # Ensure MSVC treats source files as UTF-8 encoded.
set(cxx_base_flags "${cxx_base_flags} -utf-8") if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(cxx_base_flags "${cxx_base_flags} -utf-8")
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(cxx_base_flags "-Wall -Wshadow -Wconversion") set(cxx_base_flags "-Wall -Wshadow -Wconversion")
set(cxx_exception_flags "-fexceptions") set(cxx_exception_flags "-fexceptions")