From aafa3d56469573de294f5ef58088be96d54fc267 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 1 Jul 2024 09:22:41 +0200 Subject: [PATCH] fix: defines per a compilar en raspberry pi --- Makefile | 5 +++-- source/common/jshader.cpp | 2 ++ source/common/jshader.h | 3 +++ source/common/screen.cpp | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7b7a7c4..dca16c1 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ ifeq ($(OS),Windows_NT) else FixPath = $1 SOURCES := $(shell find $(DIR_SOURCES) -name '*.cpp') - CXXFLAGS:= -std=c++11 -Wall -Os -ffunction-sections -fdata-sections -Wno-deprecated + CXXFLAGS:= -std=c++11 -Wall -Os -ffunction-sections -fdata-sections LDFLAGS := -lSDL2 RM = rm -f MKD:= mkdir -p @@ -41,6 +41,7 @@ else LDFLAGS += -lGL endif ifeq ($(UNAME_S),Darwin) + CXXFLAGS += -Wno-deprecated LDFLAGS += -framework OpenGL endif endif @@ -117,7 +118,7 @@ print-variables: @echo RM: $(RM) raspi: - $(CXX) $(SOURCES) -D RASPI $(CXXFLAGS) lSDL2 -o "$(TARGET_FILE) + $(CXX) $(SOURCES) -D RASPI $(CXXFLAGS) -lSDL2 -o $(TARGET_FILE) strip -s -R .comment -R .gnu.version "$(TARGET_FILE)_debug" --strip-unneeded windows: diff --git a/source/common/jshader.cpp b/source/common/jshader.cpp index 06ea620..4615cfb 100644 --- a/source/common/jshader.cpp +++ b/source/common/jshader.cpp @@ -1,3 +1,4 @@ +#ifndef RASPI #include "jshader.h" #include @@ -227,3 +228,4 @@ namespace shader } } } +#endif \ No newline at end of file diff --git a/source/common/jshader.h b/source/common/jshader.h index 556f796..a5c5bed 100644 --- a/source/common/jshader.h +++ b/source/common/jshader.h @@ -1,3 +1,5 @@ +#ifndef RASPI + #pragma once #include @@ -42,3 +44,4 @@ namespace shader void render(); } +#endif \ No newline at end of file diff --git a/source/common/screen.cpp b/source/common/screen.cpp index 64a5b14..76fc660 100644 --- a/source/common/screen.cpp +++ b/source/common/screen.cpp @@ -1,9 +1,11 @@ #include "screen.h" #include #include -#include "jshader.h" #include #include +#ifndef RASPI +#include "jshader.h" +#endif // Constructor Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options)