Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
00d6edd2
"python-package/vscode:/vscode.git/clone" did not exist on "015c8fff7203b7266ce187938327bc7b478a7218"
Unverified
Commit
00d6edd2
authored
Jul 03, 2024
by
Philip Hyunsu Cho
Committed by
GitHub
Jul 03, 2024
Browse files
[CMake] Use CMAKE_MSVC_RUNTIME_LIBRARY to apply /MT (#6484)
parent
a8b70784
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
CMakeLists.txt
CMakeLists.txt
+5
-12
No files found.
CMakeLists.txt
View file @
00d6edd2
...
@@ -207,6 +207,11 @@ if(__INTEGRATE_OPENCL)
...
@@ -207,6 +207,11 @@ if(__INTEGRATE_OPENCL)
endif
()
endif
()
endif
()
endif
()
if
(
BUILD_CPP_TEST AND MSVC
)
# Use /MT flag to statically link the C runtime
set
(
CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
)
endif
()
if
(
USE_CUDA
)
if
(
USE_CUDA
)
find_package
(
CUDAToolkit 11.0 REQUIRED
)
find_package
(
CUDAToolkit 11.0 REQUIRED
)
include_directories
(
${
CUDAToolkit_INCLUDE_DIRS
}
)
include_directories
(
${
CUDAToolkit_INCLUDE_DIRS
}
)
...
@@ -685,18 +690,6 @@ if(BUILD_CPP_TEST)
...
@@ -685,18 +690,6 @@ if(BUILD_CPP_TEST)
file
(
GLOB CPP_TEST_SOURCES tests/cpp_tests/*.cpp
)
file
(
GLOB CPP_TEST_SOURCES tests/cpp_tests/*.cpp
)
if
(
MSVC
)
if
(
MSVC
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/permissive-"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/permissive-"
)
set
(
CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
foreach
(
CompilerFlag
${
CompilerFlags
}
)
string
(
REPLACE
"/MD"
"/MT"
${
CompilerFlag
}
"
${${
CompilerFlag
}}
"
)
endforeach
()
endif
()
endif
()
add_executable
(
testlightgbm
${
CPP_TEST_SOURCES
}
)
add_executable
(
testlightgbm
${
CPP_TEST_SOURCES
}
)
target_link_libraries
(
testlightgbm PRIVATE lightgbm_objs lightgbm_capi_objs GTest::GTest
)
target_link_libraries
(
testlightgbm PRIVATE lightgbm_objs lightgbm_capi_objs GTest::GTest
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment