phyLS/CMakeLists.txt

36 lines
1.2 KiB
CMake
Raw Permalink Normal View History

2022-12-14 01:17:47 +00:00
cmake_minimum_required(VERSION 3.8)
2023-03-02 05:34:02 +00:00
project("phyLS" LANGUAGES CXX)
2022-12-14 01:17:47 +00:00
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(UNIX)
2023-03-02 05:34:02 +00:00
# some specific compiler definitions
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-fcolor-diagnostics" HAS_FCOLOR_DIAGNOSTICS)
if(HAS_FCOLOR_DIAGNOSTICS)
add_definitions(-fcolor-diagnostics)
2022-12-14 01:17:47 +00:00
endif()
2023-03-02 05:34:02 +00:00
# show quite some warnings (but remove some intentionally)
add_compile_options(-W -Wall -Wextra -g)
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 shift-negative-value cast-function-type implicit-fallthrough
missing-field-initializers register type-limits narrowing missing-field-initializers class-memaccess
attributes literal-suffix)
check_cxx_compiler_flag("-Wno-${WARNING}" HAS_WNO_${WARNING})
if(HAS_WNO_${WARNING})
add_compile_options(-Wno-${WARNING})
endif()
endforeach()
2022-12-14 01:17:47 +00:00
endif()
add_subdirectory(lib)
add_subdirectory(src)