summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDamien Pitard <[email protected]>2021-12-21 19:03:25 +0100
committerGitHub <[email protected]>2021-12-21 19:03:25 +0100
commitbb7b13ef3c1c06e39ef57df55757f811771e6666 (patch)
tree5f008e6c5ad6ecfd8a7ddbea31504a990024132c
parent87b9ee91834665d981fd75cdec6b1629e309c1e9 (diff)
downloadraylib-bb7b13ef3c1c06e39ef57df55757f811771e6666.tar.gz
raylib-bb7b13ef3c1c06e39ef57df55757f811771e6666.zip
fixed cross-compilation from x86-64 (debian buster) to Raspberry Pi (raspbian) (#2233)
-rw-r--r--examples/Makefile20
1 files changed, 16 insertions, 4 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 93b943ab..657da620 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -61,6 +61,15 @@ USE_EXTERNAL_GLFW ?= FALSE
# by default it uses X11 windowing system
USE_WAYLAND_DISPLAY ?= FALSE
+# Use cross-compiler for PLATFORM_RPI
+ifeq ($(PLATFORM),PLATFORM_RPI)
+ USE_RPI_CROSS_COMPILER ?= FALSE
+ ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
+ RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
+ RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
+ endif
+endif
+
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
@@ -243,9 +252,9 @@ INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external -I$(RAYLI
# Define additional directories containing required header files
ifeq ($(PLATFORM),PLATFORM_RPI)
# RPI required libraries
- INCLUDE_PATHS += -I/opt/vc/include
- INCLUDE_PATHS += -I/opt/vc/include/interface/vmcs_host/linux
- INCLUDE_PATHS += -I/opt/vc/include/interface/vcos/pthreads
+ INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include
+ INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vmcs_host/linux
+ INCLUDE_PATHS += -I$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/include/interface/vcos/pthreads
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
# DRM required libraries
@@ -310,7 +319,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
EXT = .html
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
- LDFLAGS += -L/opt/vc/lib
+ LDFLAGS += -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
endif
# Define any libraries required on linking
@@ -364,6 +373,9 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling
# NOTE: Required packages: libasound2-dev (ALSA)
LDLIBS = -lraylib -lbrcmGLESv2 -lbrcmEGL -lpthread -lrt -lm -lbcm_host -ldl
+ ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
+ LDLIBS += -lvchiq_arm -lvcos
+ endif
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
# Libraries for DRM compiling