From 31651b1066d54ad75cb073d2b9063a45b18758ba Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Mon, 19 Mar 2018 02:43:52 -0500 Subject: Make Server GC component optional (#5565) Make the Server GC an optional component by building two flavors of the runtime and selecting a specific one in the build via the `ServerGarbageCollection` MSBuild property. Don't build the Server GC flavor for Web Assembly. Fixes #5182, Fixes #5306. --- src/Native/Runtime/Full/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Native/Runtime/Full') diff --git a/src/Native/Runtime/Full/CMakeLists.txt b/src/Native/Runtime/Full/CMakeLists.txt index af7de3a21..fff2da4b3 100644 --- a/src/Native/Runtime/Full/CMakeLists.txt +++ b/src/Native/Runtime/Full/CMakeLists.txt @@ -11,6 +11,11 @@ add_definitions(-DFEATURE_RX_THUNKS) add_library(Runtime STATIC ${COMMON_RUNTIME_SOURCES} ${FULL_RUNTIME_SOURCES} ${RUNTIME_SOURCES_ARCH_ASM}) +add_library(Runtime.ServerGC STATIC ${COMMON_RUNTIME_SOURCES} ${FULL_RUNTIME_SOURCES} ${RUNTIME_SOURCES_ARCH_ASM} ${SERVER_GC_SOURCES}) + +target_compile_definitions(Runtime.ServerGC PRIVATE -DFEATURE_SVR_GC) + + # Get the current list of definitions get_compile_definitions(DEFINITIONS) @@ -72,7 +77,8 @@ foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES) endforeach() # Install the static Runtime library -install (TARGETS Runtime DESTINATION sdk) +install (TARGETS Runtime Runtime.ServerGC DESTINATION sdk) if(WIN32) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Runtime.dir/$/Runtime.pdb DESTINATION sdk) + install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Runtime.ServerGC.dir/$/Runtime.ServerGC.pdb DESTINATION sdk) endif() -- cgit v1.2.3