From 8fd778600fb31f1699a9467a5a61fbe2b60e00c0 Mon Sep 17 00:00:00 2001 From: Nat! Date: Wed, 20 Nov 2024 15:27:41 +0100 Subject: [PATCH] fix build system for -fobjc-tao flag --- RELEASENOTES.md | 6 +++++ cmake/share/CompilerDetectionC.cmake | 36 +++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 44968cd..bec392e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,3 +1,9 @@ +### 0.0.13 + + + +* adapt to change in mulle-thread + ### 0.0.12 * compile fix for musl/cosmopolitan diff --git a/cmake/share/CompilerDetectionC.cmake b/cmake/share/CompilerDetectionC.cmake index 33b88b4..5d90a07 100644 --- a/cmake/share/CompilerDetectionC.cmake +++ b/cmake/share/CompilerDetectionC.cmake @@ -9,19 +9,43 @@ if( NOT __COMPILER_DETECTION_C_CMAKE__) message( STATUS "# Include \"${CMAKE_CURRENT_LIST_FILE}\"" ) endif() + # + # for windows want a MSVC prefix + # + # CMAKE_C_COMPILER_ID, doesn't detect mulle-clang necessarily, so fallback + # on -DCMAKE_C_COMPILER + # if( NOT MULLE_C_COMPILER_ID) - if( ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ( "${CMAKE_C_COMPILER_ID}" MATCHES "^(Clang|MulleClang)$") ) - set( MULLE_C_COMPILER_ID "MSVC-${CMAKE_C_COMPILER_ID}") + string( TOUPPER "${CMAKE_C_COMPILER_ID}" TMP_NAME) + string( REGEX REPLACE "[^A-Za-z0-9]" "" TMP_NAME "${TMP_NAME}") + if( ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ( "${TMP_NAME}" MATCHES "CLANG") ) + set( MULLE_C_COMPILER_ID "MSVC-${TMP_NAME}") else() - set( MULLE_C_COMPILER_ID "${CMAKE_C_COMPILER_ID}") + get_filename_component( TMP_NAME2 "${CMAKE_C_COMPILER}" NAME_WE) + string( TOUPPER "${TMP_NAME2}" TMP_NAME2) + string( REGEX REPLACE "[^A-Za-z0-9]" "" TMP_NAME2 "${TMP_NAME2}") + if( "${TMP_NAME2}" MATCHES "MULLECLANG") + set( MULLE_C_COMPILER_ID "${TMP_NAME2}") + else() + set( MULLE_C_COMPILER_ID "${TMP_NAME}") + endif() endif() endif() if( NOT MULLE_CXX_COMPILER_ID) - if( ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ( "${CMAKE_CXX_COMPILER_ID}" MATCHES "^(Clang|MulleClang)$") ) - set( MULLE_CXX_COMPILER_ID "MSVC-${CMAKE_CXX_COMPILER_ID}") + string( TOUPPER "${CMAKE_CXX_COMPILER_ID}" TMP_NAME) + string( REGEX REPLACE "[^A-Za-z0-9]" "" TMP_NAME "${TMP_NAME}") + if( ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ( "${TMP_NAME}" MATCHES "CLANG") ) + set( MULLE_CXX_COMPILER_ID "MSVC-${TMP_NAME}") else() - set( MULLE_CXX_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}") + get_filename_component( TMP_NAME2 "${CMAKE_CXX_COMPILER}" NAME_WE) + string( TOUPPER "${TMP_NAME2}" TMP_NAME2) + string( REGEX REPLACE "[^A-Za-z0-9]" "" TMP_NAME2 "${TMP_NAME2}") + if( "${TMP_NAME2}" MATCHES "MULLECLANG") + set( MULLE_CXX_COMPILER_ID "${TMP_NAME2}") + else() + set( MULLE_CXX_COMPILER_ID "${TMP_NAME}") + endif() endif() endif()