Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with emscripten #1020

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmake/SfizzConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-mfloat-abi=hard)
endif()
endif()
if(EMSCRIPTEN)
add_compile_options(-msimd128)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
add_compile_options(/Zc:__cplusplus)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
Expand Down
2 changes: 1 addition & 1 deletion cmake/SfizzSIMDSourceFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ macro(sfizz_add_simd_sources SOURCES_VAR PREFIX)

# For CPU-dispatched X86 sources
# Always build them for all X86 targets.
if(SFIZZ_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64|x64|X64|i.86|x86|X86)$")
if(SFIZZ_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64|x64|X64|i.86|x86|X86)$" AND NOT EMSCRIPTEN)
# on GCC, it requires to set ISA support flags on individual files
# to be able to use the intrinsics
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
Expand Down
7 changes: 7 additions & 0 deletions external/atomic_queue/include/atomic_queue/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ static inline void spin_loop_pause() noexcept {
#endif
}
} // namespace atomic_queue
#elif defined(EMSCRIPTEN)
namespace atomic_queue {
constexpr int CACHE_LINE_SIZE = 64;
static inline void spin_loop_pause() noexcept {
// No-op
}
} // namespace atomic_queue
#else
#error "Unknown CPU architecture."
#endif
Expand Down
1 change: 0 additions & 1 deletion src/sfizz/EQPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "SIMDHelpers.h"
#include "utility/SwapAndPop.h"
#include <absl/algorithm/container.h>
#include <thread>

sfz::EQHolder::EQHolder(Resources& resources)
: resources(resources)
Expand Down
Loading