| @@ -28,20 +28,16 @@ endif | |||||
| # Architecture-independent flags | # Architecture-independent flags | ||||
| ifdef ARCH_X64 | ifdef ARCH_X64 | ||||
| FLAGS += -DARCH_X64 | |||||
| FLAGS += -march=nehalem | FLAGS += -march=nehalem | ||||
| endif | endif | ||||
| ifdef ARCH_ARM64 | ifdef ARCH_ARM64 | ||||
| FLAGS += -DARCH_ARM64 | |||||
| FLAGS += -march=armv8-a+fp+simd | FLAGS += -march=armv8-a+fp+simd | ||||
| endif | endif | ||||
| ifdef ARCH_LIN | ifdef ARCH_LIN | ||||
| FLAGS += -DARCH_LIN | |||||
| CXXFLAGS += -Wsuggest-override | CXXFLAGS += -Wsuggest-override | ||||
| endif | endif | ||||
| ifdef ARCH_MAC | ifdef ARCH_MAC | ||||
| FLAGS += -DARCH_MAC | |||||
| CXXFLAGS += -stdlib=libc++ | CXXFLAGS += -stdlib=libc++ | ||||
| LDFLAGS += -stdlib=libc++ | LDFLAGS += -stdlib=libc++ | ||||
| MAC_SDK_FLAGS := -mmacosx-version-min=10.9 | MAC_SDK_FLAGS := -mmacosx-version-min=10.9 | ||||
| @@ -49,7 +45,6 @@ ifdef ARCH_MAC | |||||
| LDFLAGS += $(MAC_SDK_FLAGS) | LDFLAGS += $(MAC_SDK_FLAGS) | ||||
| endif | endif | ||||
| ifdef ARCH_WIN | ifdef ARCH_WIN | ||||
| FLAGS += -DARCH_WIN | |||||
| FLAGS += -D_USE_MATH_DEFINES | FLAGS += -D_USE_MATH_DEFINES | ||||
| FLAGS += -municode | FLAGS += -municode | ||||
| CXXFLAGS += -Wsuggest-override | CXXFLAGS += -Wsuggest-override | ||||
| @@ -0,0 +1,20 @@ | |||||
| #pragma once | |||||
| // Check CPU | |||||
| #if defined __x86_64__ | |||||
| #define ARCH_X64 1 | |||||
| #endif | |||||
| #if defined __aarch64__ | |||||
| #define ARCH_ARM64 1 | |||||
| #endif | |||||
| // Check OS | |||||
| #if defined _WIN32 | |||||
| #define ARCH_WIN 1 | |||||
| #endif | |||||
| #if defined __APPLE__ | |||||
| #define ARCH_MAC 1 | |||||
| #endif | |||||
| #if defined __linux__ | |||||
| #define ARCH_LIN 1 | |||||
| #endif | |||||
| @@ -15,6 +15,8 @@ | |||||
| #include <string> | #include <string> | ||||
| #include <stdexcept> | #include <stdexcept> | ||||
| #include <arch.hpp> | |||||
| /** Attribute for deprecated functions and symbols. | /** Attribute for deprecated functions and symbols. | ||||
| E.g. | E.g. | ||||
| @@ -1,6 +1,7 @@ | |||||
| #pragma once | #pragma once | ||||
| #include <cstring> | #include <cstring> | ||||
| #include "common.hpp" | #include "common.hpp" | ||||
| #include <common.hpp> | |||||
| namespace rack { | namespace rack { | ||||
| @@ -1,7 +1,6 @@ | |||||
| #pragma once | #pragma once | ||||
| #include <simd/Vector.hpp> | #include <simd/Vector.hpp> | ||||
| #include <simd/sse_mathfun_extension.h> | #include <simd/sse_mathfun_extension.h> | ||||
| #include <common.hpp> | |||||
| #include <math.hpp> | #include <math.hpp> | ||||
| @@ -1,3 +1,5 @@ | |||||
| #include <arch.hpp> | |||||
| #if defined ARCH_MAC | #if defined ARCH_MAC | ||||
| #include <CoreFoundation/CoreFoundation.h> | #include <CoreFoundation/CoreFoundation.h> | ||||
| #include <CoreServices/CoreServices.h> | #include <CoreServices/CoreServices.h> | ||||
| @@ -1,3 +1,5 @@ | |||||
| #include <arch.hpp> | |||||
| #include <thread> | #include <thread> | ||||
| #include <map> | #include <map> | ||||
| #include <stdexcept> | #include <stdexcept> | ||||
| @@ -99,7 +101,7 @@ static InitCallback loadPluginCallback(Plugin* plugin) { | |||||
| libraryExt = "so"; | libraryExt = "so"; | ||||
| #elif defined ARCH_WIN | #elif defined ARCH_WIN | ||||
| libraryExt = "dll"; | libraryExt = "dll"; | ||||
| #elif ARCH_MAC | |||||
| #elif defined ARCH_MAC | |||||
| libraryExt = "dylib"; | libraryExt = "dylib"; | ||||
| #endif | #endif | ||||
| @@ -1,3 +1,5 @@ | |||||
| #include <arch.hpp> | |||||
| #include <ctime> | #include <ctime> | ||||
| #include <cctype> // for tolower and toupper | #include <cctype> // for tolower and toupper | ||||
| #include <algorithm> // for transform and equal | #include <algorithm> // for transform and equal | ||||
| @@ -1,3 +1,5 @@ | |||||
| #include <arch.hpp> | |||||
| #include <thread> | #include <thread> | ||||
| #include <regex> | #include <regex> | ||||
| #include <chrono> | #include <chrono> | ||||
| @@ -701,7 +703,7 @@ std::string getStackTrace() { | |||||
| // If regex fails, just use the raw line | // If regex fails, just use the raw line | ||||
| s += line; | s += line; | ||||
| } | } | ||||
| #elif ARCH_MAC | |||||
| #elif defined ARCH_MAC | |||||
| // Parse line, e.g. | // Parse line, e.g. | ||||
| // 1 Rack 0x0000000002ddc3eb _mangled_symbol + 27 | // 1 Rack 0x0000000002ddc3eb _mangled_symbol + 27 | ||||
| std::regex r(R"((\d+)\s+(.+?)\s+(.+?) (.*?) \+ (.+?))"); | std::regex r(R"((\d+)\s+(.+?)\s+(.+?) (.*?) \+ (.+?))"); | ||||
| @@ -1,3 +1,5 @@ | |||||
| #include <arch.hpp> | |||||
| #include <map> | #include <map> | ||||
| #include <queue> | #include <queue> | ||||
| #include <thread> | #include <thread> | ||||