修复macos编译
This commit is contained in:
parent
00d6b5fb69
commit
19c2b0fe2b
@ -57,9 +57,8 @@ function(retrieve_files path out_files)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# setup rtaudio
|
# setup rtaudio
|
||||||
set(RTAUDIO_API_ASIO ON CACHE BOOL "" FORCE)
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
set(RTAUDIO_API_ASIO ON CACHE BOOL "" FORCE)
|
||||||
set(RTAUDIO_API_WASAPI ON CACHE BOOL "" FORCE)
|
set(RTAUDIO_API_WASAPI ON CACHE BOOL "" FORCE)
|
||||||
set(RTAUDIO_API_DS OFF CACHE BOOL "" FORCE)
|
set(RTAUDIO_API_DS OFF CACHE BOOL "" FORCE)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
@ -13,7 +13,7 @@ void audio_buffer::resize(uint32_t channel_num, uint32_t block_size) {
|
|||||||
void audio_buffer::clear() {
|
void audio_buffer::clear() {
|
||||||
std::scoped_lock lock(lock_);
|
std::scoped_lock lock(lock_);
|
||||||
for (auto& channel : buffer_) {
|
for (auto& channel : buffer_) {
|
||||||
std::fill(channel.begin(), channel.end(), 0.f);
|
std::memset(channel.data(), 0, channel.size() * sizeof(float));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
#ifdef core_EXPORTS
|
#ifdef core_EXPORTS
|
||||||
#define CORE_API __declspec(dllexport)
|
#define CORE_API __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define CORE_API __declspec(dllimport)
|
#define CORE_API __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#define CORE_API
|
||||||
|
#endif
|
@ -18,7 +18,7 @@ public:
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
hModule = LoadLibraryA(library_path.c_str());
|
hModule = LoadLibraryA(library_path.c_str());
|
||||||
#else
|
#else
|
||||||
handle = dlopen(libraryPath.c_str(), RTLD_LAZY);
|
handle = dlopen(library_path.c_str(), RTLD_LAZY);
|
||||||
#endif
|
#endif
|
||||||
if (!get_handle()) {
|
if (!get_handle()) {
|
||||||
spdlog::error("Failed to load library: {}", library_path);
|
spdlog::error("Failed to load library: {}", library_path);
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#include "singleton_manager.h"
|
#include "singleton_manager.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <__algorithm/ranges_find.h>
|
||||||
|
#endif
|
||||||
#include "singleton.h"
|
#include "singleton.h"
|
||||||
|
|
||||||
bool singleton_initliazer::has_init(singleton* s) {
|
bool singleton_initliazer::has_init(singleton* s) {
|
||||||
|
4
third_party/mempool/extern.h
vendored
4
third_party/mempool/extern.h
vendored
@ -1,7 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
#ifdef mempool_EXPORTS
|
#ifdef mempool_EXPORTS
|
||||||
#define MEMPOOL_API __declspec(dllexport)
|
#define MEMPOOL_API __declspec(dllexport)
|
||||||
#else
|
#else
|
||||||
#define MEMPOOL_API __declspec(dllimport)
|
#define MEMPOOL_API __declspec(dllimport)
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#define MEMPOOL_API
|
||||||
|
#endif
|
2
third_party/mempool/mempool/unistd.h
vendored
2
third_party/mempool/mempool/unistd.h
vendored
@ -8,5 +8,5 @@ inline uintptr_t getpagesize() {
|
|||||||
return systemInfo.dwPageSize;
|
return systemInfo.dwPageSize;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#include <unisid.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
Loading…
x
Reference in New Issue
Block a user