Skip to content

Commit

Permalink
makefile now uses the values set by the buildconfig file
Browse files Browse the repository at this point in the history
  • Loading branch information
catriverr committed Sep 14, 2024
1 parent a6b2e48 commit 8588e70
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/bin/src/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
#include <sstream>
#include "../gmeng.h"
#include "../src/textures.cpp"
#ifndef _WIN32
#include <termios.h>
#include <sys/select.h>
#endif
#include <unistd.h>

namespace fs = std::filesystem;
Expand Down
19 changes: 18 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ifeq ($(filter debug,$(MAKECMDGOALS)), debug)
CXXFLAGS += -g
endif


ifeq ($(filter warnings,$(MAKECMDGOALS)), warnings)
CXXFLAGS += -Wall
else
Expand All @@ -65,7 +66,7 @@ ifeq ($(filter no-ncurses,$(MAKECMDGOALS)), no-ncurses)
endif

ifeq ($(filter use-external,$(MAKECMDGOALS)), use-external)
CXXFLAGS += `pkg-config --libs --cflags sdl2_ttf`
CXXFLAGS += `pkg-config --libs --cflags sdl2 sdl2_ttf`
CXXFLAGS += -DGMENG_SDL
endif

Expand Down Expand Up @@ -106,6 +107,22 @@ current_dir = $(shell pwd)
$(info compiling in $(current_dir))
include $(current_dir)/make/buildcheck.mk

ifeq ($(DEBUG_MODE),true)
$(info DEBUG_MODE set to true in build configuration, using debugger parameters for gcc)
CXXFLAGS += -fsanitize=address
CXXFLAGS += -g
endif

ifeq ($(USE_EXTERNAL),true)
$(info USE_EXTERNAL set to true in build configuration, using SDL2 parameters)
CXXFLAGS += -DGMENG_SDL
CXXFLAGS += `pkg-config --cflags --libs sdl2 sdl2_ttf`
endif

ifeq ($(USE_NCURSES),true)
$(info USE_NCURSES set to true in build configuration, using ncurses parameters)
CXXFLAGS += `pkg-config --cflags --libs ncursesw`

ifeq ($(filter configure,$(MAKECMDGOALS)),configure)
ifeq ($(HAS_PKG_CONFIG),no)
$(warning Error: pkg-config is not installed. Exiting.)
Expand Down
Binary file modified tests/out/test.o
Binary file not shown.
Binary file modified tests/out/test_1.exe
Binary file not shown.
1 change: 0 additions & 1 deletion tests/test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <arm_neon.h>
#include <cstdint>
#if GMENG_SDL
#include "SDL2/SDL.h"
Expand Down

0 comments on commit 8588e70

Please sign in to comment.