Added MSVC/Windows compatibility to a few recipes (and the main script).

This commit is contained in:
2024-06-26 10:14:57 +02:00
parent c8554282f9
commit 3171d112ce
5 changed files with 49 additions and 18 deletions

View File

@@ -6,7 +6,6 @@ import os
import pathlib
import platform
import shutil
import subprocess
import sys
_SCRIPT_STAMPFILE = '.spp_script_run'
@@ -21,7 +20,13 @@ def cook(env: Environment, remote: str = 'github', git_ref: str = '') -> dict:
# TODO: windows?
did_run_script = os.path.exists(os.path.join(repo['checkout_root'], _SCRIPT_STAMPFILE))
if not did_run_script or env['UPDATE_REPOSITORIES']:
subprocess.run(('/usr/bin/env', 'python3', 'update_glslang_sources.py'), cwd=checkout_root, stdout=sys.stdout, stderr=sys.stderr, check=True)
python_exe = os.path.realpath(sys.executable)
script_file = os.path.join(repo['checkout_root'], 'update_glslang_sources.py')
prev_cwd = os.getcwd()
os.chdir(repo['checkout_root'])
if env.Execute(f'"{python_exe}" {script_file}'):
env.Exit(1)
os.chdir(prev_cwd)
pathlib.Path(repo['checkout_root'], _SCRIPT_STAMPFILE).touch()
# generate the build_info.h
@@ -44,7 +49,7 @@ def cook(env: Environment, remote: str = 'github', git_ref: str = '') -> dict:
+ env.RGlob(os.path.join(repo['checkout_root'], 'glslang/OGLCompilersDLL/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], 'glslang/ResourceLimits/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], 'SPIRV/'), '*.cpp') \
+ env.RGlob(os.path.join(repo['checkout_root'], f'glslang/OSDependent/{platform_source_dir}/'), '*.cpp')
+ [os.path.join(repo['checkout_root'], f'glslang/OSDependent/{platform_source_dir}/ossource.cpp')]
# disable a few warnings when compiling with clang
additional_cxx_flags = {