Skip to content

Commit

Permalink
Fix osx cling
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbarton authored May 18, 2024
1 parent 465bc47 commit 34e99cc
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()

Expand Down Expand Up @@ -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}")
Expand Down Expand Up @@ -455,4 +449,4 @@ endif()
add_subdirectory(lib)
if (CPPINTEROP_ENABLE_TESTING)
add_subdirectory(unittests)
endif(CPPINTEROP_ENABLE_TESTING)
endif(CPPINTEROP_ENABLE_TESTING)

0 comments on commit 34e99cc

Please sign in to comment.