build: Move build util functions to separate file

Previously, having everything in a single file causes issues, because
build.py is also called from CMake to get the version number. This only
worked for users, who had "requests" installed, as this library is
required in build.py.
This commit is contained in:
Lars Toenning
2024-06-11 22:19:29 +02:00
parent 4a81fc400a
commit c96889bae8
4 changed files with 97 additions and 66 deletions

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
macro(get_version_number)
execute_process(COMMAND python scripts/build.py --version
execute_process(COMMAND python scripts/utils.py --version
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE SWIFT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)