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:
committed by
GitHub
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
|
||||
|
||||
Reference in New Issue
Block a user