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
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:

View File

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

View File

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

View File

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