better CMakeLists.txt and clang-format

This commit is contained in:
Phuntsok Drak-pa 2019-04-01 16:55:41 +02:00
parent 801e74d752
commit fdb6e89310
2 changed files with 12 additions and 3 deletions

View File

@ -14,7 +14,7 @@ BreakConstructorInitializersBeforeComma: 'false'
ColumnLimit: '80'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
Cpp11BracedListStyle: 'true'
IndentCaseLabels: 'true'
IndentCaseLabels: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '2'

View File

@ -6,6 +6,8 @@ project("GeneticImages"
HOMEPAGE_URL "https://labs.phundrak.fr/phundrak/genetic-images"
LANGUAGES CXX)
set(CMAKE_CXX_COMPILER /usr/bin/clang++)
file(GLOB SRC_FILES "src/*.cc")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
@ -15,9 +17,16 @@ include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
enable_cxx_compiler_flag_if_supported("-Wall")
enable_cxx_compiler_flag_if_supported("-Wextra")
enable_cxx_compiler_flag_if_supported("-Wshadow")
enable_cxx_compiler_flag_if_supported("-Wpedantic")
enable_cxx_compiler_flag_if_supported("-pedantic")
enable_cxx_compiler_flag_if_supported("-O3")
enable_cxx_compiler_flag_if_supported("-flto")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
enable_cxx_compiler_flag_if_supported("-g")
else()
enable_cxx_compiler_flag_if_supported("-O3")
enable_cxx_compiler_flag_if_supported("-flto")
endif()
# include_directories(<PUBLIC HEADER DIRECTORIES>)