From: Ivan Maidanski Date: Thu, 13 Jun 2019 22:09:15 +0000 (+0300) Subject: Fix gc_cpp.cc compilation by CMake if enable_single_obj_compilation X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c704998f635bf207d03f789911883dc3df88273d;p=gc Fix gc_cpp.cc compilation by CMake if enable_single_obj_compilation (fix of commit 17885ab0b) Issue #281 (bdwgc). * CMakeLists.txt [enable_cplusplus] (SRC): Add gc_cpp.cc after SRC overridden to extra/gc.c (not before) if enable_single_obj_compilation. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b0e4306..11857d61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,10 +93,6 @@ endif() # MESSAGE("Parallel mark requires enable_threads ON" ) #ENDIF(Threads_FOUND) -if (enable_cplusplus) - set(SRC ${SRC} gc_cpp.cc) -endif() - set(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM}) #FIXME missing the vendor field. string(TOLOWER ${_HOST} HOST) @@ -255,6 +251,10 @@ if (enable_single_obj_compilation) endif(CMAKE_USE_PTHREADS_INIT) endif() +if (enable_cplusplus) + set(SRC ${SRC} gc_cpp.cc) +endif() + add_library(gc-lib STATIC ${SRC}) set_target_properties(gc-lib PROPERTIES COMPILE_DEFINITIONS GC_NOT_DLL)