From f57a3810abfbbc1970dbca224d872eb7430fbe1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E9=B8=BF=E6=B4=8B?= <74575924+panhongyang0@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:17:47 +0800 Subject: [PATCH] Create CMakeLists.txt --- CMakeLists.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..15295c1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.8) +project(phySAT LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if(UNIX) + # some specific compiler definitions + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag("-fcolor-diagnostics" HAS_FCOLOR_DIAGNOSTICS) + if (HAS_FCOLOR_DIAGNOSTICS) + add_compile_options(-fcolor-diagnostics) + endif() + + # show quite some warnings (but remove some intentionally) + add_compile_options(-W -Wall -Wextra) + foreach (WARNING unknown-pragmas gnu-anonymous-struct nested-anon-types + sign-compare unused-parameter format delete-non-virtual-dtor unused-lambda-capture + unused-variable unused-private-field inconsistent-missing-override + unused-but-set-parameter range-loop-analysis tautological-overlap-compare macro-redefined) + check_cxx_compiler_flag("-Wno-${WARNING}" HAS_WNO_${WARNING}) + if (HAS_WNO_${WARNING}) + add_compile_options(-Wno-${WARNING}) + endif() + endforeach() +endif() + +add_subdirectory(lib) +add_subdirectory(src)