From 7e64fe70392ec2a7cacdff19c284225c1c4c0f4b Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Tue, 4 Jun 2024 00:22:37 +0800 Subject: [PATCH] trying to workaround clang bug on macOS --- src/util/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index ca246600..3e75895b 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -28,6 +28,15 @@ target_link_libraries(luisa-render-util PUBLIC luisa::compute luisa-render-include luisa-render-ext) + +# work around the clang bug: https://github.com/Homebrew/homebrew-core/issues/169820 +if (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18) + cmake_path(GET CMAKE_CXX_COMPILER PARENT_PATH CLANG_BIN_PATH) + cmake_path(GET CLANG_BIN_PATH PARENT_PATH CLANG_ROOT_PATH) + target_link_libraries(luisa-compute-core PUBLIC "-L${CLANG_ROOT_PATH}/lib/c++") +endif () + set_target_properties(luisa-render-util PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON UNITY_BUILD ${LUISA_RENDER_ENABLE_UNITY_BUILD})