Create CMakeLists.txt

pull/1/head
潘鸿洋 2022-12-14 09:17:47 +08:00 committed by GitHub
parent c91ac17cbe
commit f57a3810ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

29
CMakeLists.txt Normal file
View File

@ -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)