Fix gc_cpp.cc compilation by CMake if enable_single_obj_compilation
authorIvan Maidanski <ivmai@mail.ru>
Thu, 13 Jun 2019 22:09:15 +0000 (01:09 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 14 Jun 2019 07:16:59 +0000 (10:16 +0300)
(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.

CMakeLists.txt

index 9b0e4306013b6b99a57ff2f18da471ab661ddc77..11857d61e3c09d1e09b8f599c577f79ff298d9ed 100644 (file)
@@ -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)