ref: 6dc85875ff090fca9459606ce89631e0866d1364
parent: 36119082d2d8fd7a81e5531df5f1438b8ffa548b
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sat May 4 23:14:58 EDT 2019
Changed output executable naming scheme Now the Makefile and CMake build systems are identical: Release builds are named CSE2, and debug builds are named CSE2d. Language no longer has an effect on filename for the Makefile.
--- a/.gitignore
+++ b/.gitignore
@@ -15,18 +15,14 @@
# Exclude build output on Linux (exclude normally produced executable files)
build_en/CSE2
+build_en/CSE2d
build_en/DoConfig
+build_en/DoConfigd
-# The Makefile outputs "release" and "debug" for the english build
-build_en/release
-build_en/debug
-
build_jp/CSE2
+build_jp/CSE2d
build_jp/DoConfig
-
-# The Makefile outputs "releasejp" and "debugjp" for the japanese build
-build_jp/releasejp
-build_jp/debugjp
+build_jp/DoConfigd
# Exclude executables in the build folder (and .exe.manifest files)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,15 +274,33 @@
endforeach()
# Force strict C90
-set_property(TARGET CSE2 PROPERTY C_STANDARD 90)
-set_property(TARGET CSE2 PROPERTY C_STANDARD_REQUIRED ON)
-set_property(TARGET CSE2 PROPERTY C_EXTENSIONS OFF)
+set_target_properties(CSE2 PROPERTIES
+ C_STANDARD 90
+ C_STANDARD_REQUIRED ON
+ C_EXTENSIONS OFF
+)
# Force strict C++98
-set_property(TARGET CSE2 PROPERTY CXX_STANDARD 98)
-set_property(TARGET CSE2 PROPERTY CXX_STANDARD_REQUIRED ON)
-set_property(TARGET CSE2 PROPERTY CXX_EXTENSIONS OFF)
+set_target_properties(CSE2 PROPERTIES
+ CXX_STANDARD 98
+ CXX_STANDARD_REQUIRED ON
+ CXX_EXTENSIONS OFF
+)
+# Name debug builds "CSE2d", to distinguish them
+set_target_properties(CSE2 PROPERTIES
+ DEBUG_OUTPUT_NAME "CSE2d"
+)
+
+# Send executable to the build_en/build_jp directory
+set_target_properties(CSE2 PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIRECTORY}
+ RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BUILD_DIRECTORY}
+ RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${BUILD_DIRECTORY}
+ RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${BUILD_DIRECTORY}
+ RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY}
+)
+
# Enable link-time optimisation if available
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9))
@@ -331,15 +349,6 @@
add_subdirectory("external/freetype" EXCLUDE_FROM_ALL)
target_link_libraries(CSE2 freetype)
endif()
-
-# Send executable to the build_en/build_jp directory
-set_target_properties(CSE2 PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY ${BUILD_DIRECTORY}
- RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BUILD_DIRECTORY}
- RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${BUILD_DIRECTORY}
- RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${BUILD_DIRECTORY}
- RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BUILD_DIRECTORY}
-)
##
# DoConfig
--- a/DoConfig/CMakeLists.txt
+++ b/DoConfig/CMakeLists.txt
@@ -10,6 +10,9 @@
add_executable(DoConfig "DoConfig.cpp" "icon.rc")
+# Name debug builds "DoConfigd", to distinguish them
+set_target_properties(CSE2 PROPERTIES DEBUG_OUTPUT_NAME "DoConfigd")
+
# Windows tweak
if(WIN32)
set_target_properties(DoConfig PROPERTIES WIN32_EXECUTABLE YES) # Disable the console window
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
ifeq ($(RELEASE), 1)
CXXFLAGS = -O3 -flto
LDFLAGS = -s
- FILENAME_DEF = release
+ FILENAME_DEF = CSE2
else
CXXFLAGS = -O0 -g
- FILENAME_DEF = debug
+ FILENAME_DEF = CSE2d
endif
ifeq ($(JAPANESE), 1)
@@ -11,12 +11,6 @@
BUILD_DIR = build_jp
CXXFLAGS += -DJAPANESE
-
- ifeq ($(RELEASE), 1)
- FILENAME_DEF = releasejp
- else
- FILENAME_DEF = debugjp
- endif
else
BUILD_DIR = build_en
endif
@@ -197,11 +191,11 @@
RESOURCES += ICON/ICON_MINI.bmp
endif
-OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES)))
-DEPENDENCIES = $(addprefix obj/$(FILENAME)/, $(addsuffix .o.d, $(SOURCES)))
+OBJECTS = $(addprefix obj/$(BUILD_DIR)/$(FILENAME)/, $(addsuffix .o, $(SOURCES)))
+DEPENDENCIES = $(addprefix obj/$(BUILD_DIR)/$(FILENAME)/, $(addsuffix .o.d, $(SOURCES)))
ifeq ($(WINDOWS), 1)
- OBJECTS += obj/$(FILENAME)/win_icon.o
+ OBJECTS += obj/$(BUILD_DIR)/$(FILENAME)/win_icon.o
endif
all: $(BUILD_DIR)/$(FILENAME)
@@ -212,12 +206,12 @@
@$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
@echo Finished compiling: $@
-obj/$(FILENAME)/%.o: src/%.cpp
+obj/$(BUILD_DIR)/$(FILENAME)/%.o: src/%.cpp
@mkdir -p $(@D)
@echo Compiling $<
@$(CXX) $(CXXFLAGS) $< -o $@ -c
-obj/$(FILENAME)/Resource.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuffix .h, $(RESOURCES)))
+obj/$(BUILD_DIR)/$(FILENAME)/Resource.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuffix .h, $(RESOURCES)))
@mkdir -p $(@D)
@echo Compiling $<
@$(CXX) $(CXXFLAGS) $< -o $@ -c
@@ -234,7 +228,7 @@
include $(wildcard $(DEPENDENCIES))
-obj/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico
+obj/$(BUILD_DIR)/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico
@mkdir -p $(@D)
@windres $< $@