Add 'CONFIG+=disable-prebuilts' qmake option

When specified, qmake uses pkg-config for libraries on macOS instead of the prebuilts in the libs submodule.
This commit is contained in:
Cameron Gutman
2024-06-10 22:51:45 -05:00
parent 31641f5246
commit 83811e2a07
+8 -4
View File
@@ -52,7 +52,7 @@ win32 {
# Work around a conflict with math.h inclusion between SDL and Qt 6 # Work around a conflict with math.h inclusion between SDL and Qt 6
DEFINES += _USE_MATH_DEFINES DEFINES += _USE_MATH_DEFINES
} }
macx { macx:!disable-prebuilts {
INCLUDEPATH += $$PWD/../libs/mac/include INCLUDEPATH += $$PWD/../libs/mac/include
INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2.framework/Versions/A/Headers INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2.framework/Versions/A/Headers
INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2_ttf.framework/Versions/A/Headers INCLUDEPATH += $$PWD/../libs/mac/Frameworks/SDL2_ttf.framework/Versions/A/Headers
@@ -64,7 +64,7 @@ macx {
QMAKE_OBJECTIVE_CFLAGS += -F$$PWD/../libs/mac/Frameworks QMAKE_OBJECTIVE_CFLAGS += -F$$PWD/../libs/mac/Frameworks
} }
unix:!macx { unix:if(!macx|disable-prebuilts) {
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
PKGCONFIG += openssl sdl2 SDL2_ttf opus PKGCONFIG += openssl sdl2 SDL2_ttf opus
@@ -152,13 +152,17 @@ win32:!winrt {
CONFIG += soundio discord-rpc CONFIG += soundio discord-rpc
} }
macx { macx {
LIBS += -lssl -lcrypto -lavcodec.61 -lavutil.59 -lopus -framework SDL2 -framework SDL2_ttf !disable-prebuilts {
LIBS += -lssl -lcrypto -lavcodec.61 -lavutil.59 -lopus -framework SDL2 -framework SDL2_ttf
CONFIG += discord-rpc
}
LIBS += -lobjc -framework VideoToolbox -framework AVFoundation -framework CoreVideo -framework CoreGraphics -framework CoreMedia -framework AppKit -framework Metal -framework QuartzCore LIBS += -lobjc -framework VideoToolbox -framework AVFoundation -framework CoreVideo -framework CoreGraphics -framework CoreMedia -framework AppKit -framework Metal -framework QuartzCore
# For libsoundio # For libsoundio
LIBS += -framework CoreAudio -framework AudioUnit LIBS += -framework CoreAudio -framework AudioUnit
CONFIG += ffmpeg soundio discord-rpc CONFIG += ffmpeg soundio
} }
SOURCES += \ SOURCES += \