clutchlog/CMakeLists.txt
nojhan 243b22e4c1 feat: optimize out in Release builds
- fix: fastest scope matching,
- feat: try to allow the compiler to optimize out as many conditional statements as possible,
        which allow to use clutchlog for progress-only messages in Release mode.
- feat: build_all.sh test script,
- fix: typo in macro declarations in builds without clutchlog,
- update the README accordingly.
2020-09-15 23:12:19 +02:00

44 lines
1.4 KiB
CMake

######################################################################################
# Project settings
######################################################################################
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project("clutchlog")
enable_language(CXX) # C++
set(CMAKE_CXX_STANDARD 17)
## Current version
set(VERSION_MAJOR 0 CACHE STRING "Major version number" )
set(VERSION_MINOR 1 CACHE STRING "Minor version number" )
set(VERSION_PATCH 0 CACHE STRING "Patch version number" )
mark_as_advanced(VERSION_MAJOR VERSION_MINOR VERSION_PATCH)
set(CMAKE_CXX_STANDARD_LIBRARIES -lstdc++fs)
######################################################################################
# Configurable user settings
######################################################################################
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
# put binaries in the build directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Dump used compiler flags.
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(WITH_CLUTCHLOG "Define WITH_CLUTCHLOG, whatever the build type." OFF)
if(WITH_CLUTCHLOG)
add_definitions(-DWITH_CLUTCHLOG)
endif()
######################################################################################
# Start building
######################################################################################
enable_testing()
add_subdirectory(tests)