Support with_checksums option in CMake script
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Jun 2017 16:05:35 +0000 (19:05 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 9 Jun 2017 16:19:55 +0000 (19:19 +0300)
* CMakeLists.txt (with_checksums): New option (off by default).
* CMakeLists.txt [with_checksums && enable_threads]: Issue MESSAGE that
the configuration is not supported.
* CMakeLists.txt [with_checksums] (CHECKSUMS): Define macro.
* CMakeLists.txt [with_checksums] (SRC): Add checksums.c.

CMakeLists.txt

index d4bcd7f..236fabc 100644 (file)
@@ -137,6 +137,14 @@ IF(enable_gcj_support)
         SET(SRC ${SRC} gcj_mlc.c)
 ENDIF(enable_gcj_support)
 
+OPTION(with_checksums "Report erroneously cleared dirty bits" NO)
+IF(with_checksums)
+    IF(enable_threads)
+        MESSAGE("CHECKSUMS not compatible with USE_MUNMAP or threads")
+    ENDIF(enable_threads)
+    ADD_DEFINITIONS("-DCHECKSUMS")
+    SET(SRC ${SRC} checksums.c)
+ENDIF(with_checksums)
 
 ADD_LIBRARY(          gc-lib   STATIC      ${SRC})
 SET_TARGET_PROPERTIES(gc-lib   PROPERTIES