Skip to content

Commit

Permalink
unbreak legacy build
Browse files Browse the repository at this point in the history
  • Loading branch information
jcm93 committed Nov 13, 2024
1 parent 863f50f commit 2510754
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmake/common/compiler_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<$<CONFIG:RelWithDebInfo,Release>:TRUE>)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION $<$<CONFIG:RelWithDebInfo,Release,MinSizeRel>:TRUE>)

# Set C and C++ language standards to C17 and C++17
set(CMAKE_C_STANDARD 17)
Expand Down
6 changes: 4 additions & 2 deletions nall/intrinsics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
22 changes: 18 additions & 4 deletions nall/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"";
Expand Down
4 changes: 4 additions & 0 deletions ruby/audio/sdl.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#if !defined(MACOS_COMPILED_SDL)
#include <SDL2/SDL.h>
#else
#include "SDL.h"
#endif

struct AudioSDL : AudioDriver {
AudioSDL& self = *this;
Expand Down
4 changes: 4 additions & 0 deletions ruby/input/sdl.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#if !defined(MACOS_COMPILED_SDL)
#include <SDL2/SDL.h>
#else
#include "SDL.h"
#endif

#if defined(PLATFORM_WINDOWS)
#include "shared/rawinput.cpp"
Expand Down
4 changes: 4 additions & 0 deletions ruby/video/metal/metal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
#include <Metal/Metal.h>
#include <MetalKit/MTKView.h>

#if defined(CMAKE)
#include <librashader/librashader_ld.h>
#else
#include "librashader/librashader_ld.h"
#endif
#include "ShaderTypes.h"

struct Metal;
Expand Down
4 changes: 4 additions & 0 deletions ruby/video/opengl/opengl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#error "ruby::OpenGL3: unsupported platform"
#endif

#if defined(CMAKE)
#include <librashader/librashader_ld.h>
#else
#include "librashader/librashader_ld.h"
#endif

#include "bind.hpp"
#include "utility.hpp"
Expand Down

0 comments on commit 2510754

Please sign in to comment.