From 44d6ddddafa63bbbcd53a67540328be03a02ca40 Mon Sep 17 00:00:00 2001 From: Geraint Luff Date: Tue, 7 Oct 2025 22:38:10 +0100 Subject: [PATCH] Fixes for build errors when using CMake `-G Xcode` --- cmake/SfizzConfig.cmake | 4 +++- cmake/SfizzSIMDSourceFiles.cmake | 2 +- external/atomic_queue/include/atomic_queue/atomic_queue.h | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index 5848c72d4..346faf54a 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -97,8 +97,10 @@ endif() # Add required flags for the builds if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") gw_warn(-Wall -Wextra -Wno-multichar -Werror=return-type) - if(PROJECT_SYSTEM_PROCESSOR MATCHES "(i.86|x86_64)") + if(PROJECT_SYSTEM_PROCESSOR MATCHES "(i.86)") add_compile_options(-msse2) + elseif(PROJECT_SYSTEM_PROCESSOR MATCHES "(x86_64)") + add_compile_options(-Xarch_x86_64 -msse2) elseif(PROJECT_SYSTEM_PROCESSOR MATCHES "(arm.*)" AND NOT (PROJECT_SYSTEM_PROCESSOR MATCHES "(arm64)")) add_compile_options(-mfpu=neon) if(NOT ANDROID) diff --git a/cmake/SfizzSIMDSourceFiles.cmake b/cmake/SfizzSIMDSourceFiles.cmake index b672b6f6b..b76f2bd9d 100644 --- a/cmake/SfizzSIMDSourceFiles.cmake +++ b/cmake/SfizzSIMDSourceFiles.cmake @@ -17,7 +17,7 @@ macro(sfizz_add_simd_sources SOURCES_VAR PREFIX) ${PREFIX}/sfizz/effects/impl/ResonantStringAVX.cpp ${PREFIX}/sfizz/effects/impl/ResonantArrayAVX.cpp ${PREFIX}/sfizz/simd/HelpersAVX.cpp - PROPERTIES COMPILE_FLAGS "-mavx") + PROPERTIES COMPILE_FLAGS "-Xarch_x86_64 -mavx") endif() endif() endmacro() diff --git a/external/atomic_queue/include/atomic_queue/atomic_queue.h b/external/atomic_queue/include/atomic_queue/atomic_queue.h index 94d7a5681..8ba66b0e6 100644 --- a/external/atomic_queue/include/atomic_queue/atomic_queue.h +++ b/external/atomic_queue/include/atomic_queue/atomic_queue.h @@ -400,13 +400,13 @@ class AtomicQueue2 : public AtomicQueueCommon(tail % size_); - return Base::template do_pop_any(states_[index], elements_[index]); + return Base::do_pop_any(states_[index], elements_[index]); } template void do_push(U&& element, unsigned head) noexcept { unsigned index = details::remap_index(head % size_); - Base::template do_push_any(std::forward(element), states_[index], elements_[index]); + Base::do_push_any(std::forward(element), states_[index], elements_[index]); } public: @@ -529,13 +529,13 @@ class AtomicQueueB2 : private std::allocator_traits::template rebind_alloc(tail & (size_ - 1)); - return Base::template do_pop_any(states_[index], elements_[index]); + return Base::do_pop_any(states_[index], elements_[index]); } template void do_push(U&& element, unsigned head) noexcept { unsigned index = details::remap_index(head & (size_ - 1)); - Base::template do_push_any(std::forward(element), states_[index], elements_[index]); + Base::do_push_any(std::forward(element), states_[index], elements_[index]); } template