diff --git a/qsc/__init__.py b/qsc/__init__.py index abb6529..d043adf 100644 --- a/qsc/__init__.py +++ b/qsc/__init__.py @@ -21,11 +21,15 @@ import platform def is_windows(): return platform.system() == "Windows" +def is_mac(): + return platform.system() == "Darwin" + # Paths BASE_PATH = os.path.dirname(__file__) DATA_PATH = os.path.join(BASE_PATH, "data") WINBUILD_PATH = os.path.join(DATA_PATH, "winbuild.bat") +MACBUILD_PATH = os.path.join(DATA_PATH, "macbuild.sh") # Settings REPO_BASE_URL = "https://download.qt.io/" diff --git a/qsc/__main__.py b/qsc/__main__.py index 4afa664..b1d40f5 100644 --- a/qsc/__main__.py +++ b/qsc/__main__.py @@ -84,6 +84,10 @@ if __name__ == "__main__": os.putenv("VS_EDITION", compiler["edition"]) os.putenv("VCVARSALL", compiler.get("vcvarsall", "")) os.putenv("USE_VS", "1") + elif compiler["name"] == "clang": + if not qsc.is_mac(): + print("Only supported on macOS!") + exit(1) else: print("Unknown compiler '{}'".format(compiler.name)) exit(1) @@ -135,6 +139,8 @@ if __name__ == "__main__": if qsc.is_windows(): os.system(qsc.WINBUILD_PATH) + elif qsc.is_mac(): + os.system(qsc.MACBUILD_PATH) else: print("Not supported yet, sorry :/") exit(1) diff --git a/qsc/data/macbuild.sh b/qsc/data/macbuild.sh new file mode 100755 index 0000000..d0a4131 --- /dev/null +++ b/qsc/data/macbuild.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# QSC (Qt SDK Creator) - A tool for automatically downloading, building and stripping down Qt +# Copyright (C) 2025 OatmealDome +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -e + +../qt-everywhere-src-$RELEASE/configure \ + -opensource -confirm-license \ + $QT_CONFIGURE_OPTIONS \ + -prefix $OUTNAME \ + $QT_PLATFORM \ + -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" + +cmake --build . --parallel + +cmake --install .