Skip to content

Commit

Permalink
♻️🎨 Code cleanup and refactors (#798)
Browse files Browse the repository at this point in the history
## Description

Starting the year with some obligatory code cleanup and refactors.
The individual commits and the commit messages should more or less
convey the bigger changes.
For the most part, it's really all about defining clearer interfaces and
following some new clang-tidy suggestions.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

- [x] The pull request only contains commits that are related to it.
- [x] I have added appropriate tests and documentation.
- [ ] I have made sure that all CI jobs on GitHub pass.
- [ ] The pull request introduces no new warnings and follows the
project's style guidelines.
  • Loading branch information
burgholzer authored Jan 12, 2025
2 parents 2404c85 + c381adb commit 5c3cb8e
Show file tree
Hide file tree
Showing 69 changed files with 2,946 additions and 2,685 deletions.
32 changes: 18 additions & 14 deletions cmake/StandardProjectSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS
ON
CACHE BOOL "Export compile commands" FORCE)

option(ENABLE_IPO "Enable Interprocedural Optimization, aka Link Time Optimization (LTO)" OFF)
if(ENABLE_IPO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
# enable inter-procedural optimization if it is supported
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION
TRUE
CACHE BOOL "Enable Interprocedural Optimization" FORCE)
else()
message(DEBUG "IPO is not supported: ${ipo_output}")
endif()
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
add_compile_options(-fcolor-diagnostics)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand Down Expand Up @@ -70,3 +56,21 @@ if(DEPLOY)
"10.15"
CACHE STRING "" FORCE)
endif()

if(NOT DEPLOY)
option(ENABLE_IPO "Enable Interprocedural Optimization, aka Link Time Optimization (LTO)" ON)
else()
option(ENABLE_IPO "Enable Interprocedural Optimization, aka Link Time Optimization (LTO)" OFF)
endif()
if(ENABLE_IPO)
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
# enable inter-procedural optimization if it is supported
if(ipo_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION
TRUE
CACHE BOOL "Enable Interprocedural Optimization" FORCE)
else()
message(DEBUG "IPO is not supported: ${ipo_output}")
endif()
endif()
Loading

0 comments on commit 5c3cb8e

Please sign in to comment.