diff --git a/cmake/common/compiler_common.cmake b/cmake/common/compiler_common.cmake index 9d29b1a286..cba8351c40 100644 --- a/cmake/common/compiler_common.cmake +++ b/cmake/common/compiler_common.cmake @@ -5,7 +5,7 @@ include_guard(GLOBAL) option(ARES_COMPILE_DEPRECATION_AS_WARNING "Downgrade deprecation warnings to actual warnings" FALSE) mark_as_advanced(ARES_COMPILE_DEPRECATION_AS_WARNING) -set(CMAKE_INTERPROCEDURAL_OPTIMIZATION $<$:TRUE>) +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION $<$:TRUE>) # Set C and C++ language standards to C17 and C++17 set(CMAKE_C_STANDARD 17) diff --git a/nall/intrinsics.hpp b/nall/intrinsics.hpp index 6841d99330..8a2d1863be 100644 --- a/nall/intrinsics.hpp +++ b/nall/intrinsics.hpp @@ -104,7 +104,9 @@ namespace nall { static constexpr bool BSD = 0; }; #elif defined(__ANDROID__) - #define PLATFORM_ANDROID + #if !defined(CMAKE) + #define PLATFORM_ANDROID + #endif struct Platform { static constexpr bool Windows = 0; static constexpr bool MacOS = 0; @@ -125,7 +127,7 @@ namespace nall { }; #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) #if !defined(CMAKE) - #define PLATFORM_LINUX + #define PLATFORM_BSD #endif struct Platform { static constexpr bool Windows = 0; diff --git a/nall/path.cpp b/nall/path.cpp index b150145202..7c8eb6cc86 100644 --- a/nall/path.cpp +++ b/nall/path.cpp @@ -144,17 +144,31 @@ NALL_HEADER_INLINE auto sharedData() -> string { #elif defined(PLATFORM_MACOS) string result = "/Library/Application Support/"; #else -#if defined(ARES_PREFIX) + string result = "/usr/share/"; + #endif + if(!result) result = "."; + if(!result.endsWith("/")) result.append("/"); + return result; +} + +#if defined(PLATFORM_LINUX) || defined(PLATFORM_BSD) +NALL_HEADER_INLINE auto prefixSharedData() -> string { + #if defined(ARES_PREFIX) string result = stringize(ARES_PREFIX/share/); -#else - string result = "/usr/share"; -#endif + #else + string result; #endif if(!result) result = "."; if(!result.endsWith("/")) result.append("/"); return result; } +NALL_HEADER_INLINE auto localSharedData() -> string { + string result = "/usr/local/share/"; + return result; +} +#endif + NALL_HEADER_INLINE auto temporary() -> string { #if defined(PLATFORM_WINDOWS) wchar_t path[PATH_MAX] = L""; diff --git a/ruby/audio/sdl.cpp b/ruby/audio/sdl.cpp index b0671f963f..8b22cce7ad 100644 --- a/ruby/audio/sdl.cpp +++ b/ruby/audio/sdl.cpp @@ -1,4 +1,8 @@ +#if !defined(MACOS_COMPILED_SDL) #include +#else +#include "SDL.h" +#endif struct AudioSDL : AudioDriver { AudioSDL& self = *this; diff --git a/ruby/input/sdl.cpp b/ruby/input/sdl.cpp index 44d3e30744..57c516a128 100644 --- a/ruby/input/sdl.cpp +++ b/ruby/input/sdl.cpp @@ -1,4 +1,8 @@ +#if !defined(MACOS_COMPILED_SDL) #include +#else +#include "SDL.h" +#endif #if defined(PLATFORM_WINDOWS) #include "shared/rawinput.cpp" diff --git a/ruby/video/metal/metal.hpp b/ruby/video/metal/metal.hpp index ed04f065ad..3ef6f7e9f0 100644 --- a/ruby/video/metal/metal.hpp +++ b/ruby/video/metal/metal.hpp @@ -8,7 +8,11 @@ #include #include +#if defined(CMAKE) #include +#else +#include "librashader/librashader_ld.h" +#endif #include "ShaderTypes.h" struct Metal; diff --git a/ruby/video/opengl/opengl.hpp b/ruby/video/opengl/opengl.hpp index 5e75e393f6..b3e281a6cf 100644 --- a/ruby/video/opengl/opengl.hpp +++ b/ruby/video/opengl/opengl.hpp @@ -16,7 +16,11 @@ #error "ruby::OpenGL3: unsupported platform" #endif +#if defined(CMAKE) #include +#else +#include "librashader/librashader_ld.h" +#endif #include "bind.hpp" #include "utility.hpp"