fix: defines per a compilar en raspberry pi

This commit is contained in:
2024-07-01 09:22:41 +02:00
parent b05e1c6025
commit aafa3d5646
4 changed files with 11 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ ifeq ($(OS),Windows_NT)
else else
FixPath = $1 FixPath = $1
SOURCES := $(shell find $(DIR_SOURCES) -name '*.cpp') 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 LDFLAGS := -lSDL2
RM = rm -f RM = rm -f
MKD:= mkdir -p MKD:= mkdir -p
@@ -41,6 +41,7 @@ else
LDFLAGS += -lGL LDFLAGS += -lGL
endif endif
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
CXXFLAGS += -Wno-deprecated
LDFLAGS += -framework OpenGL LDFLAGS += -framework OpenGL
endif endif
endif endif
@@ -117,7 +118,7 @@ print-variables:
@echo RM: $(RM) @echo RM: $(RM)
raspi: 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 strip -s -R .comment -R .gnu.version "$(TARGET_FILE)_debug" --strip-unneeded
windows: windows:

View File

@@ -1,3 +1,4 @@
#ifndef RASPI
#include "jshader.h" #include "jshader.h"
#include <iostream> #include <iostream>
@@ -227,3 +228,4 @@ namespace shader
} }
} }
} }
#endif

View File

@@ -1,3 +1,5 @@
#ifndef RASPI
#pragma once #pragma once
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
@@ -42,3 +44,4 @@ namespace shader
void render(); void render();
} }
#endif

View File

@@ -1,9 +1,11 @@
#include "screen.h" #include "screen.h"
#include <string> #include <string>
#include <iostream> #include <iostream>
#include "jshader.h"
#include <fstream> #include <fstream>
#include <streambuf> #include <streambuf>
#ifndef RASPI
#include "jshader.h"
#endif
// Constructor // Constructor
Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options) Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, options_t *options)