From: Ivan Maidanski Date: Fri, 14 Jun 2019 07:12:47 +0000 (+0300) Subject: Restrict CMake project to C-only language unless enable_cplusplus X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2485abe9c0d80885befadb8e635aa9314fa6d8e;p=gc Restrict CMake project to C-only language unless enable_cplusplus 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. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 11857d61..9fec37b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,12 @@ # 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)