1
0
mirror of synced 2024-11-12 02:00:52 +01:00

build: Fix building issues on macOS with clang 18

This commit is contained in:
WerWolv 2024-09-08 10:45:38 +02:00
parent 87db9def32
commit 871a0d535c
2 changed files with 10 additions and 0 deletions

View File

@ -582,6 +582,12 @@ macro(setupCompilerFlags target)
endif ()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE)
execute_process(COMMAND brew --prefix llvm OUTPUT_VARIABLE LLVM_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
endif()
# Disable some warnings for gcc
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(IMHEX_C_CXX_FLAGS "${IMHEX_C_CXX_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-dangling-reference")

View File

@ -3,5 +3,9 @@
#if __cpp_lib_jthread >= 201911L
#include <thread>
#else
#define __stop_callback_base __stop_callback_base_j
#define __stop_state __stop_state_j
#include "../jthread/source/jthread.hpp"
#undef __stop_callback_base
#undef __stop_state
#endif