]> granicus.if.org Git - gc/commitdiff
Restrict CMake project to C-only language unless enable_cplusplus
authorIvan Maidanski <ivmai@mail.ru>
Fri, 14 Jun 2019 07:12:47 +0000 (10:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 14 Jun 2019 07:16:58 +0000 (10:16 +0300)
Issue #281 (bdwgc).

* CMakeLists.txt (enable_cplusplus): Move option to above project
command.
* CMakeLists.txt [!enable_cplusplus] (project): Specify C as the only
project language.

CMakeLists.txt

index 11857d61e3c09d1e09b8f599c577f79ff298d9ed..9fec37b6ee402d9b7ee9939c2ae0d2b3d1c533f2 100644 (file)
 #  this will generate gc.sln
 #
 
-project(gc)
+option(enable_cplusplus "C++ support" OFF)
+if (enable_cplusplus)
+  project(gc)
+else()
+  project(gc C)
+endif()
 
 include(CTest)
 
@@ -34,7 +39,6 @@ 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)
-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)