cmake_minimum_required(VERSION 3.1)
+option(enable_threads "TODO" OFF) #TODO Support it
+option(enable_parallel_mark "Parallelize marking and free list construction" ON)
+option(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON)
+option(enable_threads_discovery "Enable threads discovery in GC" ON)
+#TODO Support OPTION(enable_cplusplus "install C++ support" OFF)
+option(enable_gcj_support "Support for gcj" ON)
+option(enable_gc_debug "Support for pointer back-tracing" OFF)
+option(enable_java_finalization "Support for java finalization" ON)
+option(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON)
+option(enable_redirect_malloc "Redirect malloc and friends to GC routines" OFF)
+option(enable_disclaim "Support alternative finalization interface" ON)
+option(enable_large_config "Optimize for large heap or root set" OFF)
+option(enable_gc_assertions "Enable collector-internal assertion checking" OFF)
+option(enable_mmap "Use mmap instead of sbrk to expand the heap" OFF)
+option(enable_munmap "Return page to the OS if empty for N collections" ON)
+option(enable_dynamic_loading "Enable tracing of dynamic library data roots" ON)
+option(enable_register_main_static_data "Perform the initial guess of data root sets" ON)
+option(enable_checksums "Report erroneously cleared dirty bits" OFF)
+option(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON)
+
add_definitions("-D_CRT_SECURE_NO_DEPRECATE")
add_definitions("-DALL_INTERIOR_POINTERS -DNO_EXECUTE_PERMISSION")
mallocx.c)
set(LIBS)
-option(enable_threads "TODO" OFF)
if (enable_threads)
find_package(Threads REQUIRED)
message("Thread Model: ${CMAKE_THREAD_LIBS_INIT}" )
set(LIBS ${LIBS} ${Threads_LIBRARIES})
endif()
-option(enable_handle_fork "Attempt to ensure a usable collector after fork()" ON)
-option(enable_thread_local_alloc "Turn on thread-local allocation optimization" ON)
-option(enable_parallel_mark "Parallelize marking and free list construction" ON)
-
#IF(Threads_FOUND)
# ADD_DEFINITIONS("")
#ELSE
# MESSAGE("Parallel mark requires enable_threads ON" )
#ENDIF(Threads_FOUND)
-#OPTION(enable_cplusplus "install C++ support" ON)
set(SRC ${SRC} gc_cpp.cc)
set(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM})
set(SRC ${SRC} win32_threads.c)
endif(CMAKE_USE_WIN32_THREADS_INIT)
-option(enable_gcj_support "Support for gcj" ON)
if (enable_gcj_support)
add_definitions("-DGC_GCJ_SUPPORT")
if (enable_threads)
set(SRC ${SRC} gcj_mlc.c)
endif(enable_gcj_support)
-option(enable_disclaim "Support alternative finalization interface" ON)
if (enable_disclaim)
add_definitions("-DENABLE_DISCLAIM")
set(SRC ${SRC} fnlz_mlc.c)
endif()
-option(enable_java_finalization "Support for java finalization" ON)
if (enable_java_finalization)
add_definitions("-DJAVA_FINALIZATION")
endif()
-option(enable_atomic_uncollectable "Support for atomic uncollectible allocation" ON)
if (enable_atomic_uncollectable)
add_definitions("-DGC_ATOMIC_UNCOLLECTABLE")
endif()
-option(enable_gc_debug "Support for pointer back-tracing" OFF)
if (enable_gc_debug)
add_definitions("-DDBG_HDRS_ALL -DKEEP_BACK_PTRS")
if (HOST MATCHES ia64-.*-linux.*|i586-.*-linux.*|i686-.*-linux.*|x86-.*-linux.*|x86_64-.*-linux.*)
endif()
endif(enable_gc_debug)
-option(enable_redirect_malloc "Redirect malloc and friends to GC routines" OFF)
if (enable_redirect_malloc)
if (enable_gc_debug)
add_definitions("-DREDIRECT_MALLOC=GC_debug_malloc_replacement")
add_definitions("-DGC_USE_DLOPEN_WRAP")
endif(enable_redirect_malloc)
-option(enable_mmap "Use mmap instead of sbrk to expand the heap" OFF)
-
-option(enable_munmap "Return page to the OS if empty for N collections" ON)
if (enable_munmap)
add_definitions("-DUSE_MMAP -DUSE_MUNMAP")
elseif (enable_mmap)
add_definitions("-DUSE_MMAP")
endif()
-option(enable_dynamic_loading "Enable tracing of dynamic library data roots" ON)
if (NOT enable_dynamic_loading)
add_definitions("-DIGNORE_DYNAMIC_LOADING")
endif()
-option(enable_register_main_static_data "Perform the initial guess of data root sets" ON)
if (NOT enable_register_main_static_data)
add_definitions("-DGC_DONT_REGISTER_MAIN_STATIC_DATA")
endif()
-option(enable_large_config "Optimize for large heap or root set" OFF)
if (enable_large_config)
add_definitions("-DLARGE_CONFIG")
endif()
-option(enable_gc_assertions "Enable collector-internal assertion checking" OFF)
if (enable_gc_assertions)
add_definitions("-DGC_ASSERTIONS")
endif()
-option(enable_threads_discovery "Enable threads discovery in GC" ON)
if (NOT enable_threads_discovery)
add_definitions("-DGC_NO_THREADS_DISCOVERY")
endif()
-option(enable_checksums "Report erroneously cleared dirty bits" OFF)
if (enable_checksums)
if (enable_munmap OR enable_threads)
message("CHECKSUMS not compatible with USE_MUNMAP or threads")