Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,39 @@ FetchContent_Declare(
FIND_PACKAGE_ARGS
)

# ##############################################################################
# Initial compilation flags for build types we care about. Setting these in the
# cache before project() prevents CMake's per-compiler defaults from overwriting
# them; using DEFINED CACHE{} respects any value the user has already placed in
# the cache (e.g. via -D on the command line).
if(NOT DEFINED CACHE{CMAKE_CXX_FLAGS_DEBUG})
set(
CMAKE_CXX_FLAGS_DEBUG
"-Og -g"
CACHE STRING
"Flags used by the CXX compiler during DEBUG builds."
)
endif()

if(NOT DEFINED CACHE{CMAKE_CXX_FLAGS_RELEASE})
set(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -g0 -DNDEBUG"
CACHE STRING
"Flags used by the CXX compiler during RELEASE builds."
)
endif()

if(NOT DEFINED CACHE{CMAKE_CXX_FLAGS_RELWITHDEBINFO})
set(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-O3 -fno-omit-frame-pointer -g -DNDEBUG"
CACHE STRING
"Flags used by the CXX compiler during RELWITHDEBINFO builds."
)
endif()
# ##############################################################################

# Make cetmodules available
FetchContent_MakeAvailable(cetmodules)
find_package(cetmodules 4.01.01 REQUIRED)
Expand All @@ -49,8 +82,8 @@ project(phlex VERSION 0.1.0 LANGUAGES CXX)
cet_cmake_env()
# ##############################################################################

# Set CI/test timeouts to a conservative value to avoid long stalls in CI.
# Use cache variables so generated CTest/Dart files pick this up when configured.
# Set CI/test timeouts to a conservative value to avoid long stalls in CI. Use
# cache variables so generated CTest/Dart files pick this up when configured.
set(DART_TESTING_TIMEOUT 90 CACHE STRING "Timeout (s) for Dart/CTest runs")
set(CTEST_TEST_TIMEOUT 90 CACHE STRING "Per-test timeout (s) for CTest")

Expand Down
Loading