From 42b2fe0813add95557e4c4cede968906da10f2c7 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Fri, 8 Nov 2024 21:41:35 +0100 Subject: [PATCH] prevent in source build --- .github/workflows/ci_tests.yml | 7 +++---- .gitignore | 7 ++----- CMakeLists.txt | 4 ++++ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index f0fafcd..bc2b321 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -31,14 +31,13 @@ jobs: strategy: fail-fast: false matrix: - # TODO: platform: [ubuntu-24.04, macos-15] - platform: [ubuntu-24.04] + platform: [ubuntu-24.04, macos-15] compiler: - cpp: g++-14 c: gcc-14 - cpp: clang++-18 c: clang-18 - cpp_version: [20, 23, 26] + cpp_version: [17, 20, 23, 26] cmake_args: - description: "Default" args: "" @@ -71,7 +70,7 @@ jobs: - name: Install Ninja uses: lukka/get-cmake@latest with: - cmakeVersion: "~3.30.0" + cmakeVersion: "~3.25.0" ninjaVersion: "^1.11.1" - name: Print installed softwares run: | diff --git a/.gitignore b/.gitignore index 8736258..d82e612 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,8 @@ # -# TODO(CK): prevent in source build! +# prevent in source build! # -*.cmake /CMakeCache.txt +/CMakeFiles/ /CMakeUserPresets.json /build /stagedir -CMakeFiles/ -Makefile -compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt index ec37b35..8509837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,10 @@ project( LANGUAGES CXX ) +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed!") +endif() + include(CPack) include(FetchContent) include(GNUInstallDirs)