list(APPEND update_dep_command "${CMAKE_GENERATOR}")
if (CMAKE_GENERATOR_PLATFORM)
- set(_target_arch ${CMAKE_GENERATOR_PLATFORM})
- else()
- if (MSVC_IDE)
- message(WARNING "CMAKE_GENERATOR_PLATFORM not set. Using x64 as target architecture.")
- endif()
- set(_target_arch x64)
+ list(APPEND update_dep_command "--arch")
+ list(APPEND update_dep_command "${CMAKE_GENERATOR_PLATFORM}")
endif()
- list(APPEND update_dep_command "--arch")
- list(APPEND update_dep_command "${_target_arch}")
if (NOT CMAKE_BUILD_TYPE)
message(WARNING "CMAKE_BUILD_TYPE not set. Using Debug for dependency build type")
set(UPDATE_DEPS_HASH "0" CACHE STRING "Default value until we run update_deps.py")
mark_as_advanced(UPDATE_DEPS_HASH)
+ if ("${UPDATE_DEPS_HASH}" STREQUAL "0")
+ list(APPEND update_dep_command "--clean-build")
+ list(APPEND update_dep_command "--clean-install")
+ endif()
+
if ("${md5_hash}" STREQUAL $CACHE{UPDATE_DEPS_HASH})
message(DEBUG "update_deps.py: no work to do.")
else()
execute_process(
COMMAND ${Python3_EXECUTABLE} ${update_dep_command}
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE _update_deps_result
)
if (NOT (${_update_deps_result} EQUAL 0))
include("${UPDATE_DEPS_DIR}/helper.cmake")
endif()
endif()
-
if (VULKAN_HEADERS_INSTALL_DIR)
list(APPEND CMAKE_PREFIX_PATH ${VULKAN_HEADERS_INSTALL_DIR})
endif()
if (CMAKE_CROSSCOMPILING)
- set(CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
+ set(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH} ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
else()
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
endif()
# Copyright 2017 The Glslang Authors. All rights reserved.
# Copyright (c) 2018-2023 Valve Corporation
# Copyright (c) 2018-2023 LunarG, Inc.
+# Copyright (c) 2023-2023 RasterGrid Kft.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
repository at a "known-good" commit in order to provide stability in
the dependent repositories.
-Python Compatibility
---------------------
-
-This program can be used with Python 2.7 and Python 3.
-
Known-Good JSON Database
------------------------
The name of the dependent repository. This field can be referenced
by the "deps.repo_name" structure to record a dependency.
+- api
+
+The name of the API the dependency is specific to (e.g. "vulkan").
+
- url
Specifies the URL of the repository.
"""
-from __future__ import print_function
-
import argparse
import json
import os.path
def on_rm_error( func, path, exc_info):
"""Error handler for recursively removing a directory. The
shutil.rmtree function can fail on Windows due to read-only files.
- This handler will change the permissions for tha file and continue.
+ This handler will change the permissions for the file and continue.
"""
os.chmod( path, stat.S_IWRITE )
os.unlink( path )
self.build_step = json['build_step'] if ('build_step' in json) else 'build'
self.build_platforms = json['build_platforms'] if ('build_platforms' in json) else []
self.optional = set(json.get('optional', []))
+ self.api = json['api'] if ('api' in json) else None
# Absolute paths for a repo's directories
dir_top = os.path.abspath(args.dir)
self.repo_dir = os.path.join(dir_top, self.sub_dir)
def CMakeConfig(self, repos):
"""Build CMake command for the configuration phase and execute it"""
if self._args.do_clean_build:
- shutil.rmtree(self.build_dir)
+ if os.path.isdir(self.build_dir):
+ shutil.rmtree(self.build_dir, onerror=on_rm_error)
if self._args.do_clean_install:
- shutil.rmtree(self.install_dir)
+ if os.path.isdir(self.install_dir):
+ shutil.rmtree(self.install_dir, onerror=on_rm_error)
# Create and change to build directory
make_or_exist_dirs(self.build_dir)
install_names = GetInstallNames(args)
with open(filename, 'w') as helper_file:
for repo in repos:
+ # If the repo has an API tag and that does not match
+ # the target API then skip it
+ if repo.api is not None and repo.api != args.api:
+ continue
if install_names and repo.name in install_names and repo.on_build_platform:
helper_file.write('set({var} "{dir}" CACHE STRING "" FORCE)\n'
.format(
type=str.lower,
help="Set build files configuration",
default='debug')
+ parser.add_argument(
+ '--api',
+ dest='api',
+ default='vulkan',
+ choices=['vulkan'],
+ help="Target API")
parser.add_argument(
'--generator',
dest='generator',
print('Starting builds in {d}'.format(d=abs_top_dir))
for repo in repos:
+ # If the repo has an API tag and that does not match
+ # the target API then skip it
+ if repo.api is not None and repo.api != args.api:
+ continue
+
# If the repo has a platform whitelist, skip the repo
# unless we are building on a whitelisted platform.
if not repo.on_build_platform: