From a2b8f69bb1fdec2ee301bb417f62a66d776f2430 Mon Sep 17 00:00:00 2001 From: njohnson Date: Tue, 13 Jan 2026 14:37:52 -0500 Subject: [PATCH] Fix macOS build: make Windows-only libraries conditional - DevIL, bundled zlib, and xcompress64 only linked on Windows - macOS/Linux use system zlib (-lz) - DLL deployment only on Windows Co-Authored-By: Claude Opus 4.5 --- app/app.pro | 26 ++++++++++++++++++++------ tools/cli/cli.pro | 16 +++++++++++----- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/app/app.pro b/app/app.pro index 912ec69..24275e6 100644 --- a/app/app.pro +++ b/app/app.pro @@ -23,15 +23,25 @@ FORMS += $$files($$PWD/*.ui) RESOURCES += ../data/Data.qrc +# Core libraries (all platforms) LIBS += \ - -L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \ - -L$$PWD/../third_party/zlib/lib/ -lzlib \ - -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ -L$$OUT_PWD/../libs/ -lcore \ -L$$OUT_PWD/../libs/ -lcompression \ -L$$OUT_PWD/../libs/ -ldsl \ -L$$OUT_PWD/../libs/ -lencryption +# Windows-only: DevIL, bundled zlib, Xbox SDK +win32 { + LIBS += -L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT + LIBS += -L$$PWD/../third_party/zlib/lib/ -lzlib + LIBS += -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 +} + +# macOS/Linux: use system zlib +unix { + LIBS += -lz +} + INCLUDEPATH += \ $$PWD/../third_party/devil_sdk/include/ \ $$PWD/../third_party/zlib/include \ @@ -62,7 +72,11 @@ defs_install.files = $$PWD/../definitions/* scripts_install.path = $$FULL_OUT_DIR/scripts scripts_install.files = $$PWD/../scripts/* -dll_install.path = $$FULL_OUT_DIR -dll_install.files = $$PWD/../third_party/xbox_sdk/lib/xcompress64.dll +INSTALLS += defs_install scripts_install -INSTALLS += defs_install scripts_install dll_install +# Windows-only: deploy DLLs +win32 { + dll_install.path = $$FULL_OUT_DIR + dll_install.files = $$PWD/../third_party/xbox_sdk/lib/xcompress64.dll + INSTALLS += dll_install +} diff --git a/tools/cli/cli.pro b/tools/cli/cli.pro index 4cf138a..4309256 100644 --- a/tools/cli/cli.pro +++ b/tools/cli/cli.pro @@ -13,7 +13,11 @@ SOURCES += main.cpp # Link against the DSL library LIBS += -L$$OUT_PWD/../../libs -ldsl -lcompression -lcore -lencryption -LIBS += -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 + +# Windows-only: Xbox SDK +win32 { + LIBS += -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 +} # Include paths INCLUDEPATH += \ @@ -32,7 +36,9 @@ CONFIG(debug, debug|release) { FULL_OUT_DIR = $$OUT_PWD/release } -dll_install.path = $$FULL_OUT_DIR -dll_install.files = $$PWD/../../third_party/xbox_sdk/lib/xcompress64.dll - -INSTALLS += dll_install +# Windows-only: deploy DLLs +win32 { + dll_install.path = $$FULL_OUT_DIR + dll_install.files = $$PWD/../../third_party/xbox_sdk/lib/xcompress64.dll + INSTALLS += dll_install +}