mirror of
https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git
synced 2025-05-15 01:08:39 +00:00
Move vk_safe_struct to VUL
This code was being generated in both Vulkan-ValidationLayers and Vulkan-ExtensionLayer. Further uses are on the horizon so lets stop the copypasta. Also, add functions to manipulate extension lists and pNext chains, since many client layers have been doing that themselves.
This commit is contained in:
parent
d90f5c7eb1
commit
cdd0e00cff
26 changed files with 91119 additions and 68 deletions
54
scripts/common_ci.py
Normal file
54
scripts/common_ci.py
Normal file
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/python3 -i
|
||||
#
|
||||
# Copyright (c) 2015-2024 The Khronos Group Inc.
|
||||
# Copyright (c) 2015-2024 Valve Corporation
|
||||
# Copyright (c) 2015-2024 LunarG, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import platform
|
||||
|
||||
# Use Ninja for all platforms for performance/simplicity
|
||||
os.environ['CMAKE_GENERATOR'] = "Ninja"
|
||||
|
||||
# helper to define paths relative to the repo root
|
||||
def RepoRelative(path):
|
||||
return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', path))
|
||||
|
||||
# Points to the directory containing the top level CMakeLists.txt
|
||||
PROJECT_SRC_DIR = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], '..'))
|
||||
if not os.path.isfile(f'{PROJECT_SRC_DIR}/CMakeLists.txt'):
|
||||
print(f'PROJECT_SRC_DIR invalid! {PROJECT_SRC_DIR}')
|
||||
sys.exit(1)
|
||||
|
||||
# Returns true if we are running in GitHub actions
|
||||
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
|
||||
def IsGHA():
|
||||
if 'GITHUB_ACTION' in os.environ:
|
||||
return True
|
||||
return False
|
||||
|
||||
# Runs a command in a directory and returns its return code.
|
||||
# Directory is project root by default, or a relative path from project root
|
||||
def RunShellCmd(command, start_dir = PROJECT_SRC_DIR, env=None, verbose=False):
|
||||
# Flush stdout here. Helps when debugging on CI.
|
||||
sys.stdout.flush()
|
||||
|
||||
if start_dir != PROJECT_SRC_DIR:
|
||||
start_dir = RepoRelative(start_dir)
|
||||
cmd_list = command.split(" ")
|
||||
|
||||
# Helps a lot when debugging CI issues
|
||||
if IsGHA():
|
||||
verbose = True
|
||||
|
||||
if verbose:
|
||||
print(f'CICMD({cmd_list}, env={env})')
|
||||
subprocess.check_call(cmd_list, cwd=start_dir, env=env)
|
||||
|
||||
#
|
||||
# Check if the system is Windows
|
||||
def IsWindows(): return 'windows' == platform.system().lower()
|
Loading…
Add table
Add a link
Reference in a new issue