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_cplusplus "C++ support" OFF)
option(enable_gcj_support "Support for gcj" ON)
option(enable_sigrt_signals "Use SIGRTMIN-based signals for thread suspend/resume" OFF)
option(enable_gc_debug "Support for pointer back-tracing" OFF)
# MESSAGE("Parallel mark requires enable_threads ON" )
#ENDIF(Threads_FOUND)
-set(SRC ${SRC} gc_cpp.cc)
+if (enable_cplusplus)
+ set(SRC ${SRC} gc_cpp.cc)
+endif()
set(_HOST ${CMAKE_HOST_SYSTEM_PROCESSOR}--${CMAKE_SYSTEM})
#FIXME missing the vendor field.
add_definitions("-DGC_NOT_DLL")
# Compile some tests as C++ to test extern "C" in header files.
-set_source_files_properties(
- leak_test.c
- test.c
- PROPERTIES LANGUAGE CXX)
+if (enable_cplusplus)
+ set_source_files_properties(leak_test.c test.c
+ PROPERTIES LANGUAGE CXX)
+endif()
add_executable(gctest WIN32 test.c)
target_link_libraries(gctest gc-lib)
add_executable(smashtest smash_test.c)
target_link_libraries(smashtest gc-lib)
add_test(NAME smashtest COMMAND smashtest)
+
+if (enable_cplusplus)
+ # TODO add_executable(test_cpp test_cpp.cc)
+ # target_link_libraries(test_cpp gc-lib)
+ # add_test(NAME test_cpp COMMAND test_cpp)
+endif()