mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: allow theoretical ARM builds
this requires your device to support desktop GL3+ and might require manual setting of the TOOLCHAIN variable
This commit is contained in:
1 parent
2b6b205a78
commit
b4207b3fd9
2 files changed
+26
-10
No files matched your search
+8
-2
@@ -132,10 +132,16 @@ ifneq (,$(findstring windows,$(TARGET_PLATFORM)))
|
||||
TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I)
|
||||
TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lz -lopengl32 -static-libstdc++
|
||||
# on windows/mingw we need this to be built with a 32-bit compiler so it finds the correct libs
|
||||
TOOLCHAIN := i686-w64-mingw32-
|
||||
else # TODO
|
||||
TOOLCHAIN ?= i686-w64-mingw32-
|
||||
else # assume *nix
|
||||
TARGET_CFLAGS := $(shell pkg-config sdl2 --cflags-only-I)
|
||||
TARGET_LDFLAGS := $(shell pkg-config sdl2 --libs) -lGL -lz
|
||||
ifneq (,$(findstring arm,$(TARGET_PLATFORM))$(findstring aarch,$(TARGET_PLATFORM)))
|
||||
# linux on arm or aarch64
|
||||
# TODO: detect soft/hardfloat abi
|
||||
TARGET_LDFLAGS += -ldl
|
||||
TOOLCHAIN ?= arm-linux-gnueabihf-
|
||||
endif
|
||||
endif
|
||||
|
||||
# On x86_64 gcc add -m32 to CFLAGS if building a 32-bit executable.
|
||||
|
||||
+18
-8
@@ -4,14 +4,13 @@
|
||||
// detect OS
|
||||
#if defined(_WIN32)
|
||||
#define PLATFORM_WIN32 1
|
||||
#else
|
||||
// assume POSIX compatible
|
||||
#elif defined(__linux__)
|
||||
#define PLATFORM_POSIX 1
|
||||
#if defined(__linux__)
|
||||
#define PLATFORM_LINUX 1
|
||||
#else // TODO
|
||||
#error "Unknown platform."
|
||||
#endif
|
||||
#define PLATFORM_LINUX 1
|
||||
#else
|
||||
// assume POSIX-compatible
|
||||
#define PLATFORM_POSIX 1
|
||||
#warning "Unknown OS. Please add it to platform.h."
|
||||
#endif
|
||||
|
||||
// detect arch
|
||||
@@ -20,10 +19,21 @@
|
||||
#define PLATFORM_64BIT 1
|
||||
#elif defined(__i386__) || defined(_X86_) || defined(_M_IX86)
|
||||
#define PLATFORM_X86 1
|
||||
#else // TODO
|
||||
#elif defined(__aarch64__) || defined(_M_ARM64)
|
||||
#define PLATFORM_ARM 8
|
||||
#define PLATFORM_64BIT 1
|
||||
#elif defined(__arm__) || defined(_M_ARM)
|
||||
// assume armv7
|
||||
#define PLATFORM_ARM 7
|
||||
#else
|
||||
#error "Unknown CPU arch."
|
||||
#endif
|
||||
|
||||
// TODO: remove this after 64-bit support is in place
|
||||
#ifdef PLATFORM_64BIT
|
||||
#error "64-bit platforms are currently not supported."
|
||||
#endif
|
||||
|
||||
// detect endianness
|
||||
#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__)
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
|
||||
Reference in new issue
Block a user