Explicitly use UTF-8 codepage when using MSVC (#5197)
* Explicitly use UTF-8 codepage when using MSVC * Fix build with CUDA enabled
This commit is contained in:
parent
a73e25e15f
commit
0184f2e9f7
@ -33,6 +33,12 @@ if (USE_CUDA)
|
||||
$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=${OpenMP_CXX_FLAGS}>
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(objxgboost PRIVATE
|
||||
$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=/utf-8>
|
||||
)
|
||||
endif (MSVC)
|
||||
|
||||
set_target_properties(objxgboost PROPERTIES
|
||||
CUDA_SEPARABLE_COMPILATION OFF)
|
||||
else (USE_CUDA)
|
||||
@ -52,6 +58,12 @@ if (WIN32 AND MINGW)
|
||||
target_compile_options(objxgboost PUBLIC -static-libstdc++)
|
||||
endif (WIN32 AND MINGW)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(objxgboost PRIVATE
|
||||
$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>
|
||||
)
|
||||
endif (MSVC)
|
||||
|
||||
set_target_properties(objxgboost PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
CXX_STANDARD 11
|
||||
|
||||
@ -43,8 +43,19 @@ if (USE_CUDA)
|
||||
target_include_directories(testxgboost PRIVATE "${NVTX_HEADER_DIR}")
|
||||
target_compile_definitions(testxgboost PRIVATE -DXGBOOST_USE_NVTX=1)
|
||||
endif (USE_NVTX)
|
||||
if (MSVC)
|
||||
target_compile_options(testxgboost PRIVATE
|
||||
$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=/utf-8>
|
||||
)
|
||||
endif (MSVC)
|
||||
endif (USE_CUDA)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(testxgboost PRIVATE
|
||||
$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>
|
||||
)
|
||||
endif (MSVC)
|
||||
|
||||
target_include_directories(testxgboost
|
||||
PRIVATE
|
||||
${GTEST_INCLUDE_DIRS}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user