From ae8744358a93a6f98da01b7327d6efe3dbeb8572 Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 15 Jun 2026 11:36:03 +0200 Subject: [PATCH] cmake format --- .gitea/workflows/cmake_build.yml | 2 +- .github/workflows/build_with_docs.yml | 2 +- CMakeLists.txt | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/cmake_build.yml b/.gitea/workflows/cmake_build.yml index 505a381..f150988 100644 --- a/.gitea/workflows/cmake_build.yml +++ b/.gitea/workflows/cmake_build.yml @@ -47,7 +47,7 @@ jobs: source venv/bin/activate mkdir build cd build - cmake .. -DAARE_PYTHON_BINDINGS=ON -DAARE_DOCS=ON + cmake .. -DAARE_PYTHON_BINDINGS=ON -DAARE_DOCS=ON -DAARE_WARNINGS_AS_ERRORS=ON make -j 2 make docs diff --git a/.github/workflows/build_with_docs.yml b/.github/workflows/build_with_docs.yml index dc54995..bbae4f9 100644 --- a/.github/workflows/build_with_docs.yml +++ b/.github/workflows/build_with_docs.yml @@ -47,7 +47,7 @@ jobs: run: | mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DAARE_SYSTEM_LIBRARIES=ON -DAARE_PYTHON_BINDINGS=ON -DAARE_DOCS=ON -DAARE_TESTS=ON + cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DAARE_SYSTEM_LIBRARIES=ON -DAARE_PYTHON_BINDINGS=ON -DAARE_DOCS=ON -DAARE_TESTS=ON -DAARE_WARNINGS_AS_ERRORS=ON make -j 4 make docs diff --git a/CMakeLists.txt b/CMakeLists.txt index d9c07b0..3c8c31b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,9 @@ option(AARE_FETCH_ZMQ "Use FetchContent to download libzmq" ON) option(AARE_FETCH_LMFIT "Use FetchContent to download lmfit" ON) option(AARE_FETCH_MINUIT2 "Use FetchContent to download Minuit2" ON) +option(AARE_WARNINGS_AS_ERRORS "Treat warnings as errors during compilation" + OFF) + # Convenience option to use system libraries only (no FetchContent) option(AARE_SYSTEM_LIBRARIES "Use system libraries" OFF) if(AARE_SYSTEM_LIBRARIES) @@ -349,6 +352,10 @@ else() # builds ) + if(AARE_WARNINGS_AS_ERRORS) + target_compile_options(aare_compiler_flags INTERFACE -Werror) + endif() + endif() # GCC/Clang specific if(AARE_PYTHON_BINDINGS)