mirror of
https://github.com/overte-org/overte.git
synced 2025-06-15 12:06:31 +02:00
Add a way to get VCPKG path and hash ID
This commit is contained in:
parent
f9b5c786fb
commit
0e2131e80c
3 changed files with 30 additions and 17 deletions
10
hifi_qt.py
10
hifi_qt.py
|
@ -81,7 +81,7 @@ endif()
|
||||||
|
|
||||||
qt_found = True
|
qt_found = True
|
||||||
system_qt = True
|
system_qt = True
|
||||||
print("Using system Qt")
|
#print("Using system Qt")
|
||||||
|
|
||||||
elif os.getenv('OVERTE_QT_PATH', "") != "":
|
elif os.getenv('OVERTE_QT_PATH', "") != "":
|
||||||
# 2. Using an user-provided directory.
|
# 2. Using an user-provided directory.
|
||||||
|
@ -92,7 +92,7 @@ endif()
|
||||||
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
|
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
|
||||||
|
|
||||||
qt_found = True
|
qt_found = True
|
||||||
print("Using Qt from " + self.fullPath)
|
#print("Using Qt from " + self.fullPath)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# 3. Using a pre-built Qt.
|
# 3. Using a pre-built Qt.
|
||||||
|
@ -135,7 +135,7 @@ endif()
|
||||||
self.lockFile = os.path.join(lockDir, lockName)
|
self.lockFile = os.path.join(lockDir, lockName)
|
||||||
|
|
||||||
if qt_found:
|
if qt_found:
|
||||||
print("Found pre-built Qt5")
|
#print("Found pre-built Qt5")
|
||||||
return
|
return
|
||||||
|
|
||||||
if 'Windows' == system:
|
if 'Windows' == system:
|
||||||
|
@ -147,8 +147,8 @@ endif()
|
||||||
cpu_architecture = platform.machine()
|
cpu_architecture = platform.machine()
|
||||||
|
|
||||||
if 'x86_64' == cpu_architecture:
|
if 'x86_64' == cpu_architecture:
|
||||||
# `major_version()` can return blank string on rolling release distros like arch
|
# `major_version()` can return blank string on rolling release distros like arch
|
||||||
# The `or 0` conditional assignment prevents the int parsing error from hiding the useful Qt package error
|
# The `or 0` conditional assignment prevents the int parsing error from hiding the useful Qt package error
|
||||||
u_major = int( distro.major_version() or '0' )
|
u_major = int( distro.major_version() or '0' )
|
||||||
if distro.id() == 'ubuntu' or distro.id() == 'linuxmint':
|
if distro.id() == 'ubuntu' or distro.id() == 'linuxmint':
|
||||||
if (distro.id() == 'ubuntu' and u_major == 20) or distro.id() == 'linuxmint' and u_major == 20:
|
if (distro.id() == 'ubuntu' and u_major == 20) or distro.id() == 'linuxmint' and u_major == 20:
|
||||||
|
|
|
@ -71,7 +71,7 @@ endif()
|
||||||
os.makedirs(self.basePath)
|
os.makedirs(self.basePath)
|
||||||
self.path = os.path.join(self.basePath, self.id)
|
self.path = os.path.join(self.basePath, self.id)
|
||||||
|
|
||||||
print("Using vcpkg path {}".format(self.path))
|
#print("Using vcpkg path {}".format(self.path))
|
||||||
lockDir, lockName = os.path.split(self.path)
|
lockDir, lockName = os.path.split(self.path)
|
||||||
lockName += '.lock'
|
lockName += '.lock'
|
||||||
if not os.path.isdir(lockDir):
|
if not os.path.isdir(lockDir):
|
||||||
|
|
35
prebuild.py
35
prebuild.py
|
@ -1,19 +1,19 @@
|
||||||
#!python
|
#!python
|
||||||
|
|
||||||
# The prebuild script is intended to simplify life for developers and dev-ops. It's repsonsible for acquiring
|
# The prebuild script is intended to simplify life for developers and dev-ops. It's repsonsible for acquiring
|
||||||
# tools required by the build as well as dependencies on which we rely.
|
# tools required by the build as well as dependencies on which we rely.
|
||||||
#
|
#
|
||||||
# By using this script, we can reduce the requirements for a developer getting started to:
|
# By using this script, we can reduce the requirements for a developer getting started to:
|
||||||
#
|
#
|
||||||
# * A working C++ dev environment like visual studio, xcode, gcc, or clang
|
# * A working C++ dev environment like visual studio, xcode, gcc, or clang
|
||||||
# * Qt
|
# * Qt
|
||||||
# * CMake
|
# * CMake
|
||||||
# * Python 3.x
|
# * Python 3.x
|
||||||
#
|
#
|
||||||
# The function of the build script is to acquire, if not already present, all the other build requirements
|
# The function of the build script is to acquire, if not already present, all the other build requirements
|
||||||
# The build script should be idempotent. If you run it with the same arguments multiple times, that should
|
# The build script should be idempotent. If you run it with the same arguments multiple times, that should
|
||||||
# have no negative impact on the subsequent build times (i.e. re-running the prebuild script should not
|
# have no negative impact on the subsequent build times (i.e. re-running the prebuild script should not
|
||||||
# trigger a header change that causes files to be rebuilt). Subsequent runs after the first run should
|
# trigger a header change that causes files to be rebuilt). Subsequent runs after the first run should
|
||||||
# execute quickly, determining that no work is to be done
|
# execute quickly, determining that no work is to be done
|
||||||
|
|
||||||
import hifi_singleton
|
import hifi_singleton
|
||||||
|
@ -83,6 +83,9 @@ def parse_args():
|
||||||
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
|
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
|
||||||
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
|
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
|
||||||
parser.add_argument('--ci-build', action='store_true', default=os.getenv('CI_BUILD') is not None)
|
parser.add_argument('--ci-build', action='store_true', default=os.getenv('CI_BUILD') is not None)
|
||||||
|
parser.add_argument('--get-vcpkg-id', action='store_true', help='Get the VCPKG ID, the hash path of the full VCPKG path')
|
||||||
|
parser.add_argument('--get-vcpkg-path', action='store_true', help='Get the full VCPKG path, ID included.')
|
||||||
|
|
||||||
if True:
|
if True:
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
else:
|
else:
|
||||||
|
@ -91,7 +94,7 @@ def parse_args():
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Fixup env variables. Leaving `USE_CCACHE` on will cause scribe to fail to build
|
# Fixup env variables. Leaving `USE_CCACHE` on will cause scribe to fail to build
|
||||||
# VCPKG_ROOT seems to cause confusion on Windows systems that previously used it for
|
# VCPKG_ROOT seems to cause confusion on Windows systems that previously used it for
|
||||||
# building OpenSSL
|
# building OpenSSL
|
||||||
removeEnvVars = ['VCPKG_ROOT', 'USE_CCACHE']
|
removeEnvVars = ['VCPKG_ROOT', 'USE_CCACHE']
|
||||||
for var in removeEnvVars:
|
for var in removeEnvVars:
|
||||||
|
@ -129,11 +132,21 @@ def main():
|
||||||
qt.writeConfig()
|
qt.writeConfig()
|
||||||
else:
|
else:
|
||||||
if (os.environ["OVERTE_USE_SYSTEM_QT"]):
|
if (os.environ["OVERTE_USE_SYSTEM_QT"]):
|
||||||
print("System Qt selected")
|
#print("System Qt selected")
|
||||||
|
None
|
||||||
else:
|
else:
|
||||||
raise Exception("Internal error: System Qt not selected, but hifi_qt.py failed to return a cmake path")
|
raise Exception("Internal error: System Qt not selected, but hifi_qt.py failed to return a cmake path")
|
||||||
|
|
||||||
pm = hifi_vcpkg.VcpkgRepo(args)
|
pm = hifi_vcpkg.VcpkgRepo(args)
|
||||||
|
|
||||||
|
if args.get_vcpkg_id:
|
||||||
|
print(pm.id)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
if args.get_vcpkg_path:
|
||||||
|
print(pm.path)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
if qtInstallPath is not None:
|
if qtInstallPath is not None:
|
||||||
pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)
|
pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)
|
||||||
|
|
||||||
|
@ -149,7 +162,7 @@ def main():
|
||||||
if not pm.upToDate():
|
if not pm.upToDate():
|
||||||
pm.bootstrap()
|
pm.bootstrap()
|
||||||
|
|
||||||
# Always write the tag, even if we changed nothing. This
|
# Always write the tag, even if we changed nothing. This
|
||||||
# allows vcpkg to reclaim disk space by identifying directories with
|
# allows vcpkg to reclaim disk space by identifying directories with
|
||||||
# tags that haven't been touched in a long time
|
# tags that haven't been touched in a long time
|
||||||
pm.writeTag()
|
pm.writeTag()
|
||||||
|
@ -190,7 +203,7 @@ def main():
|
||||||
|
|
||||||
logger.info('end')
|
logger.info('end')
|
||||||
|
|
||||||
print(sys.argv)
|
#print(sys.argv)
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except hifi_utils.SilentFatalError as fatal_ex:
|
except hifi_utils.SilentFatalError as fatal_ex:
|
||||||
|
|
Loading…
Reference in a new issue