Skip to content

Commit a3d9fc0

Browse files
authored
Remove -mwindows linker flag for msys2 build and adjust OPT flags on various platform (#7872)
#changelog #msys
1 parent 23a2ee7 commit a3d9fc0

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

libs/openFrameworksCompiled/project/msys2/config.msys2.default.mk

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ ifeq ($(findstring MINGW64,$(MSYSTEM)),MINGW64)
129129
PLATFORM_LDFLAGS += -Wl,--disable-dynamicbase,--disable-high-entropy-va,--default-image-base-low
130130
endif
131131

132-
ifndef DEBUG
133-
PLATFORM_LDFLAGS += -mwindows
134-
endif
135132
ifeq ($(findstring OF_USING_STD_FS, $(PLATFORM_DEFINES)),OF_USING_STD_FS)
136133
PLATFORM_LDFLAGS += -lstdc++fs
137134
endif
@@ -151,7 +148,7 @@ endif
151148
##########################################################################################
152149

153150
# RELEASE Debugging options (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)
154-
PLATFORM_OPTIMIZATION_CFLAGS_RELEASE = -Os
151+
PLATFORM_OPTIMIZATION_CFLAGS_RELEASE = -O3
155152

156153
# DEBUG Debugging options (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)
157154
PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = -g3 #-D_GLIBCXX_DEBUG
@@ -233,7 +230,7 @@ PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/utf8/%
233230

234231
PLATFORM_LIBRARIES += ksuser opengl32 gdi32 msimg32 glu32 dsound winmm strmiids #dxguid
235232
PLATFORM_LIBRARIES += uuid ole32 oleaut32 setupapi wsock32 ws2_32 Iphlpapi Comdlg32
236-
PLATFORM_LIBRARIES += freeimage
233+
PLATFORM_LIBRARIES += freeimage
237234
# PLATFORM_LIBRARIES += boost_filesystem-mt boost_system-mt
238235
PLATFORM_LIBRARIES += mf mfplat mfuuid mfreadwrite
239236
# PLATFORM_LIBRARIES += glfw3
@@ -324,13 +321,13 @@ copy_dlls:
324321
@echo " copying dlls to bin"
325322

326323
@ntldd --recursive $(wildcard bin/$(APPNAME)*.exe) | sed -e 's:\\:/:g' | grep -F "$(MINGW_PREFIX)" | cut -d">" -f2 |cut -d" " -f2 >dlllist
327-
324+
328325
@while read -r dll; do \
329326
test -e "$$dll" && cp "$$dll" ./bin; \
330327
done <dlllist
331328
@echo " `wc -l <dlllist` dlls copied"
332329
@rm dlllist
333-
330+
334331
afterplatform: $(TARGET_NAME)
335332
-cp ${OF_LIBS_PATH}/*/lib/${PLATFORM_LIB_SUBPATH}/*.${SHARED_LIB_EXTENSION} bin/ ; true
336333
@echo

libs/openFrameworksCompiled/project/osx/config.osx.default.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ PLATFORM_LDFLAGS += -mmacosx-version-min=$(MAC_OS_MIN_VERSION) -v
185185
##########################################################################################
186186

187187
# RELEASE Debugging options (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)
188-
PLATFORM_OPTIMIZATION_CFLAGS_RELEASE = -Os
188+
PLATFORM_OPTIMIZATION_CFLAGS_RELEASE = -O3
189189

190190
# DEBUG Debugging options (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)
191191
PLATFORM_OPTIMIZATION_CFLAGS_DEBUG = -g3
@@ -366,7 +366,7 @@ afterplatform: $(TARGET_NAME)
366366
# Use the openFrameworks-Info.plist as the default. Feel free to edit it in your project folder to override and values.
367367
@if [ ! -f openFrameworks-Info.plist ]; then cp $(OF_ROOT)/scripts/templates/osx/openFrameworks-Info.plist openFrameworks-Info.plist; fi
368368
@cp openFrameworks-Info.plist bin/$(BIN_NAME).app/Contents/Info.plist;
369-
369+
370370
# App icons
371371
ifeq ($(RUN_TARGET), RunRelease)
372372
@if [ -f of.icns ]; then cp of.icns bin/$(BIN_NAME).app/Contents/Resources/; else cp $(OF_LIBS_PATH)/openFrameworksCompiled/project/osx/of.icns bin/$(BIN_NAME).app/Contents/Resources/; fi
@@ -375,13 +375,13 @@ afterplatform: $(TARGET_NAME)
375375
@if [ -f of_debug.icns ]; then cp of_debug.icns bin/$(BIN_NAME).app/Contents/Resources/; else cp $(OF_LIBS_PATH)/openFrameworksCompiled/project/osx/of_debug.icns bin/$(BIN_NAME).app/Contents/Resources/; fi
376376
@sed -i '' 's/\$$(ICON_NAME)/of_debug.icns/g' bin/$(BIN_NAME).app/Contents/Info.plist
377377
endif
378-
378+
379379
@sed -i '' 's/\$$(DEVELOPMENT_LANGUAGE)/English/g' bin/$(BIN_NAME).app/Contents/Info.plist
380380
@sed -i '' 's/\$$(EXECUTABLE_NAME)/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
381381
@sed -i '' 's/\$$(TARGET_NAME)/$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
382382
@sed -i '' 's/\$$(PRODUCT_BUNDLE_IDENTIFIER)/cc.openFrameworks.$(BIN_NAME)/g' bin/$(BIN_NAME).app/Contents/Info.plist
383383
@sed -i '' 's/\$$(VERSION)/1.0/g' bin/$(BIN_NAME).app/Contents/Info.plist
384-
384+
385385
@echo TARGET=$(TARGET)
386386
@mv $(TARGET) bin/$(BIN_NAME).app/Contents/MacOS
387387

0 commit comments

Comments
 (0)