Skip to content

Commit

Permalink
build: Fix building issues on macOS with clang 18
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Sep 8, 2024
1 parent 87db9de commit 871a0d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmake/build_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions lib/third_party/jthread/includes/jthread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 871a0d5

Please sign in to comment.