Skip to content

Commit

Permalink
cmake workaround for the /bin/sh: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-…
Browse files Browse the repository at this point in the history
…NOTFOUND: command not found issue
  • Loading branch information
darioizzo committed Sep 23, 2024
1 parent 3602617 commit 3b8b01e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# NOTE: current minimum kep3 requirement.
cmake_minimum_required(VERSION 3.18.0)
cmake_minimum_required(VERSION 3.28.0)
# This effectively requests behavior preferred as of a given CMake version and tells newer CMake versions to warn about their new policies.
cmake_policy(VERSION 3.30)

# This removes a strange behaviour on osx CI machines where ninja would error out with
# '/bin/sh: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: command not found' even if clang-scan-deps was installed
# Since we here do not use modules we deactivate their search.
set(CMAKE_CXX_SCAN_FOR_MODULES 0)

# Set default build type to "Release".
# NOTE: this should be done before the project command since the latter can set
# CMAKE_BUILD_TYPE itself (it does so for nmake).
Expand Down
10 changes: 8 additions & 2 deletions cmake/yacma/YACMACompilerLinkerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ if(NOT _YACMACompilerLinkerSettingsRun)
# Configuration bits specific for GCC.
if(YACMA_COMPILER_IS_GNUCXX)
_YACMA_CHECK_ENABLE_CXX_FLAG(-fdiagnostics-color=auto)
_YACMA_CHECK_ENABLE_CXX_FLAG(-Woverloaded-virtual)
# New in GCC 9.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Waddress-of-packed-member)
endif()
Expand Down Expand Up @@ -109,7 +110,6 @@ if(NOT _YACMACompilerLinkerSettingsRun)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wc99-designator)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wreorder-init-list)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-pointer-div)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class)
# New warnings in clang 11.
Expand All @@ -122,13 +122,19 @@ if(NOT _YACMACompilerLinkerSettingsRun)
# NOTE: this is a new flag in Clang 13 which seems to give
# incorrect warnings for UDLs.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-bounds-pointer-arithmetic)
# New warnings in clang 14.
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-parameter)
endif()

# Common configuration for GCC, clang and Intel.
if(YACMA_COMPILER_IS_CLANGXX OR YACMA_COMPILER_IS_INTELXX OR YACMA_COMPILER_IS_GNUCXX)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wall)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wextra)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
# NOTE: this flag has been superseded by "-Wdelete-non-virtual-dtor"
# (enabled by "-Wall"). See:
# https://gcc.gnu.org/pipermail/gcc-cvs/2022-November/374730.html
# _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnon-virtual-dtor)
# NOTE: this flag is a bit too chatty, let's disable it for the moment.
#_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnoexcept)
_YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wlogical-op)
Expand Down

0 comments on commit 3b8b01e

Please sign in to comment.