From 34e99ccd12a6984c72cbccbe601dbb485739c424 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Sat, 18 May 2024 18:44:38 +0100 Subject: [PATCH] Fix osx cling --- CMakeLists.txt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5caabd15..b9888002e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) message(STATUS "Found supported version: Clang ${CLANG_PACKAGE_VERSION}") message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}") - ## Clang 13 require c++14 or later, Clang 16 require c++17 or later. + ## Clang 13 require c++14 or later (using 17 to allow c++17 attribute [[maybe_unused]] in tests), Clang 16 require c++17 or later. if (CLANG_VERSION_MAJOR GREATER_EQUAL 16) if (NOT CMAKE_CXX_STANDARD) set (CMAKE_CXX_STANDARD 17) @@ -184,10 +184,10 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) endif() elseif (CLANG_VERSION_MAJOR GREATER_EQUAL 13) if (NOT CMAKE_CXX_STANDARD) - set (CMAKE_CXX_STANDARD 14) + set (CMAKE_CXX_STANDARD 17) endif() - if (CMAKE_CXX_STANDARD LESS 14) - message(fatal "LLVM/CppInterOp requires c++14 or later") + if (CMAKE_CXX_STANDARD LESS 17) + message(fatal "LLVM/CppInterOp requires c++17 or later") endif() endif() @@ -327,12 +327,6 @@ include_directories(BEFORE SYSTEM #Removes flag due to issue with Google test download when LLVM_ENABLE_WERROR=On string(REPLACE "-Wcovered-switch-default" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -message(CXX_OPTS "${CMAKE_CXX_FLAGS}") -message(MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") -message(EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") -message(SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") -message(SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}") - file(STRINGS "VERSION" CPPINTEROP_VERSION) string(REGEX MATCH "([0-9]*)\.([0-9]*)\.([0-9]*)" CPPINTEROP_VERSION_ONLY "${CPPINTEROP_VERSION}") set(CPPINTEROP_VERSION_MAJOR "${CMAKE_MATCH_1}") @@ -455,4 +449,4 @@ endif() add_subdirectory(lib) if (CPPINTEROP_ENABLE_TESTING) add_subdirectory(unittests) -endif(CPPINTEROP_ENABLE_TESTING) \ No newline at end of file +endif(CPPINTEROP_ENABLE_TESTING)