]> granicus.if.org Git - gc/commitdiff
Fix MS VC warning about compiling unused checksums and thread_local_alloc
authorIvan Maidanski <ivmai@mail.ru>
Tue, 31 Jan 2017 23:21:22 +0000 (02:21 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 6 Feb 2017 18:59:51 +0000 (21:59 +0300)
* CMakeLists.txt (SRC): Remove checksums.c (to avoid MS VC warning
about unused file).
* CMakeLists.txt (SRC): Do not add thread_local_alloc.c unless
ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC") present.

CMakeLists.txt

index 622d8151f1fdeee95b069fb088c4d9d06ee97978..05d398afad5a477ae30a9e864725d48663fe8601 100644 (file)
@@ -51,8 +51,7 @@ INCLUDE_DIRECTORIES(libatomic_ops/src)
 SET(SRC alloc.c reclaim.c allchblk.c misc.c mach_dep.c os_dep.c
         mark_rts.c headers.c mark.c obj_map.c blacklst.c finalize.c
         new_hblk.c dbg_mlc.c malloc.c stubborn.c dyn_load.c
-        typd_mlc.c ptr_chck.c gc_cpp.cc mallocx.c checksums.c
-        thread_local_alloc.c)
+        typd_mlc.c ptr_chck.c mallocx.c gc_cpp.cc)
 SET(LIBS)
 OPTION(enable_threads "TODO" NO)
 IF(enable_threads)
@@ -91,6 +90,7 @@ IF(CMAKE_USE_PTHREADS_INIT)
                         ADD_DEFINITIONS("-DPARALLEL_MARK")
                 ENDIF()
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
+                SET(SRC ${SRC} thread_local_alloc.c)
                 MESSAGE("Explicit GC_INIT() calls may be required.")
         ENDIF()
         IF ( HOST MATCHES .*-.*-linux.*)
@@ -129,11 +129,13 @@ IF(CMAKE_USE_PTHREADS_INIT)
                 ENDIF()
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
                 ADD_DEFINITIONS("-DUSE_COMPILER_TLS")
+                SET(SRC ${SRC} thread_local_alloc.c)
         ENDIF()
         IF ( HOST MATCHES .*-.*-gnu.*)
                 ADD_DEFINITIONS("-DGC_GNU_THREADS")
                 ADD_DEFINITIONS("-D_REENTRANT")
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
+                SET(SRC ${SRC} thread_local_alloc.c)
         ENDIF()
         IF ( HOST MATCHES .*-.*-netbsd.*)
                 MESSAGE("Only on NetBSD 2.0 or later.")
@@ -144,6 +146,7 @@ IF(CMAKE_USE_PTHREADS_INIT)
         IF ( HOST MATCHES .*-.*-solaris.*)
                 ADD_DEFINITIONS("-DGC_SOLARIS_THREADS")
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
+                SET(SRC ${SRC} thread_local_alloc.c)
 #TODO
 #       if test "$GCC" != yes; then
 #          CFLAGS="$CFLAGS -O"
@@ -160,7 +163,7 @@ IF(CMAKE_USE_PTHREADS_INIT)
                         ADD_DEFINITIONS("-DPARALLEL_MARK")
                 ENDIF()
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
-
+                SET(SRC ${SRC} thread_local_alloc.c)
 #TODO
 #       win32_threads=true
         ENDIF()
@@ -168,10 +171,10 @@ IF(CMAKE_USE_PTHREADS_INIT)
                 ADD_DEFINITIONS("-DGC_DARWIN_THREADS")
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
                 MESSAGE("Explicit GC_INIT() calls may be required.")
-                SET(SRC ${SRC} darwin_stop_world.c)
                 IF (${enable_parallel_mark})
                        ADD_DEFINITIONS("-DPARALLEL_MARK")
                 ENDIF()
+                SET(SRC ${SRC} darwin_stop_world.c thread_local_alloc.c)
                 #TODO
                 #darwin_threads=true
         ENDIF()
@@ -180,6 +183,7 @@ IF(CMAKE_USE_PTHREADS_INIT)
                 IF (${enable_parallel_mark})
                         ADD_DEFINITIONS("-DPARALLEL_MARK")
                         ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
+                        SET(SRC ${SRC} thread_local_alloc.c)
                         MESSAGE("Explicit GC_INIT() calls may be required.")
                         # May want to enable it in other cases, too.
                         # Measurements haven't yet been done.
@@ -197,6 +201,7 @@ IF(CMAKE_USE_WIN32_THREADS_INIT)
         IF (${enable_parallel_mark})
                 ADD_DEFINITIONS("-DPARALLEL_MARK")
                 ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
+                SET(SRC ${SRC} thread_local_alloc.c)
         ENDIF()
         ADD_DEFINITIONS("-DEMPTY_GETENV_RESULTS") #TODO test
         SET(SRC ${SRC} win32_threads.c)