Add macOS support

This commit is contained in:
OatmealDome
2025-05-23 12:02:03 -04:00
parent 4f591deced
commit 6c52f62cde
3 changed files with 40 additions and 0 deletions

View File

@@ -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/"

View File

@@ -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)

30
qsc/data/macbuild.sh Executable file
View File

@@ -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 <http://www.gnu.org/licenses/>.
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 .