Skip to content

Commit 8c66146

Browse files
authored
Removed MSVC static library setting (#940)
Edit and continue only for top level cmake usage Static link is useful for releasing binary samples, but I'm not doing that yet. #936
1 parent 2810d8d commit 8c66146

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

CMakeLists.txt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ message(STATUS "CMake C++ compiler: ${CMAKE_CXX_COMPILER_ID}")
1818
message(STATUS "CMake system name: ${CMAKE_SYSTEM_NAME}")
1919
message(STATUS "CMake host system processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
2020

21-
# static link
22-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
23-
2421
if (MSVC OR APPLE)
2522
option(BOX2D_SANITIZE "Enable sanitizers for some builds" OFF)
2623
if(BOX2D_SANITIZE)
@@ -34,12 +31,6 @@ if (MSVC OR APPLE)
3431
add_compile_options(-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=undefined)
3532
add_link_options(-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=undefined)
3633
endif()
37-
else()
38-
if(MSVC)
39-
# enable hot reloading
40-
add_compile_options("$<$<CONFIG:Debug>:/ZI>")
41-
add_link_options("$<$<CONFIG:Debug>:/INCREMENTAL>")
42-
endif()
4334
endif()
4435
endif()
4536

@@ -77,6 +68,12 @@ if(PROJECT_IS_TOP_LEVEL)
7768

7869
if(BOX2D_UNIT_TESTS OR BOX2D_SAMPLES OR BOX2D_BENCHMARKS)
7970

71+
if(MSVC AND NOT BOX2D_SANITIZE)
72+
# enable hot reloading
73+
add_compile_options("$<$<CONFIG:Debug>:/ZI>")
74+
add_link_options("$<$<CONFIG:Debug>:/INCREMENTAL>")
75+
endif()
76+
8077
# Emscripten pthread support for enkiTS
8178
if(EMSCRIPTEN)
8279
set(EMSCRIPTEN_PTHREADS_COMPILER_FLAGS "-pthread -s USE_PTHREADS=1")

0 commit comments

Comments
 (0)