ref: c4599bc14624c0f51929dd0785dbf560b6bea051
parent: cdbcd5f6c33135a8a083abae24f26ff3ba0be343
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sat Aug 10 18:47:40 EDT 2019
Allow third-party in-source files to go in the external folder
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -328,6 +328,9 @@
CXX_EXTENSIONS OFF
)
+# Include directory for third-party software
+target_include_directories(CSE2 PRIVATE "external")
+
# Name debug builds "CSE2_debug", to distinguish them
set_target_properties(CSE2 PROPERTIES DEBUG_OUTPUT_NAME "CSE2_debug")
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@
CXXFLAGS += -DRASPBERRY_PI
endif
-CXXFLAGS += -std=c++98 `pkg-config sdl2 --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d
+CXXFLAGS += -std=c++98 -Iexternal `pkg-config sdl2 --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d
ifeq ($(STATIC), 1)
LDFLAGS += -static
@@ -57,77 +57,77 @@
# For an accurate result to the original's code, compile in alphabetical order
SOURCES = \
- ArmsItem \
- Back \
- Boss \
- BossAlmo1 \
- BossAlmo2 \
- BossBallos \
- BossFrog \
- BossIronH \
- BossLife \
- BossOhm \
- BossPress \
- BossTwinD \
- BossX \
- BulHit \
- Bullet \
- Caret \
- Config \
- Draw \
- Ending \
- Escape \
- Fade \
- File \
- Flags \
- Flash \
- Font \
- Frame \
- Game \
- Generic \
- GenericLoad \
- Input \
- KeyControl \
- Main \
- Map \
- MapName \
- MiniMap \
- MyChar \
- MycHit \
- MycParam \
- NpcAct000 \
- NpcAct020 \
- NpcAct040 \
- NpcAct060 \
- NpcAct080 \
- NpcAct100 \
- NpcAct120 \
- NpcAct140 \
- NpcAct160 \
- NpcAct180 \
- NpcAct200 \
- NpcAct220 \
- NpcAct240 \
- NpcAct260 \
- NpcAct280 \
- NpcAct300 \
- NpcAct320 \
- NpcAct340 \
- NpChar \
- NpcHit \
- NpcTbl \
- Organya \
- PixTone \
- Profile \
- Resource \
- SelStage \
- Shoot \
- Sound \
- Stage \
- Star \
- TextScr \
- Triangle \
- ValueView
+ src/ArmsItem \
+ src/Back \
+ src/Boss \
+ src/BossAlmo1 \
+ src/BossAlmo2 \
+ src/BossBallos \
+ src/BossFrog \
+ src/BossIronH \
+ src/BossLife \
+ src/BossOhm \
+ src/BossPress \
+ src/BossTwinD \
+ src/BossX \
+ src/BulHit \
+ src/Bullet \
+ src/Caret \
+ src/Config \
+ src/Draw \
+ src/Ending \
+ src/Escape \
+ src/Fade \
+ src/File \
+ src/Flags \
+ src/Flash \
+ src/Font \
+ src/Frame \
+ src/Game \
+ src/Generic \
+ src/GenericLoad \
+ src/Input \
+ src/KeyControl \
+ src/Main \
+ src/Map \
+ src/MapName \
+ src/MiniMap \
+ src/MyChar \
+ src/MycHit \
+ src/MycParam \
+ src/NpcAct000 \
+ src/NpcAct020 \
+ src/NpcAct040 \
+ src/NpcAct060 \
+ src/NpcAct080 \
+ src/NpcAct100 \
+ src/NpcAct120 \
+ src/NpcAct140 \
+ src/NpcAct160 \
+ src/NpcAct180 \
+ src/NpcAct200 \
+ src/NpcAct220 \
+ src/NpcAct240 \
+ src/NpcAct260 \
+ src/NpcAct280 \
+ src/NpcAct300 \
+ src/NpcAct320 \
+ src/NpcAct340 \
+ src/NpChar \
+ src/NpcHit \
+ src/NpcTbl \
+ src/Organya \
+ src/PixTone \
+ src/Profile \
+ src/Resource \
+ src/SelStage \
+ src/Shoot \
+ src/Sound \
+ src/Stage \
+ src/Star \
+ src/TextScr \
+ src/Triangle \
+ src/ValueView
RESOURCES = \
BITMAP/Credit01.bmp \
@@ -209,7 +209,7 @@
endif
ifeq ($(RENDERER), OpenGL3)
- SOURCES += Backends/Rendering/OpenGL3
+ SOURCES += src/Backends/Rendering/OpenGL3
CXXFLAGS += `pkg-config glew --cflags`
ifeq ($(STATIC), 1)
@@ -218,11 +218,11 @@
LIBS += `pkg-config glew --libs`
endif
else ifeq ($(RENDERER), Texture)
- SOURCES += Backends/Rendering/SDLTexture
+ SOURCES += src/Backends/Rendering/SDLTexture
else ifeq ($(RENDERER), Surface)
- SOURCES += Backends/Rendering/SDLSurface
+ SOURCES += src/Backends/Rendering/SDLSurface
else ifeq ($(RENDERER), Software)
- SOURCES += Backends/Rendering/Software
+ SOURCES += src/Backends/Rendering/Software
else
@echo Invalid RENDERER selected; this build will fail
endif
@@ -247,7 +247,7 @@
@echo Linking $@
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
-obj/$(FILENAME)/%.o: src/%.cpp
+obj/$(FILENAME)/%.o: %.cpp
@mkdir -p $(@D)
@echo Compiling $<
@$(CXX) $(CXXFLAGS) $< -o $@ -c