diff options
author | Mike Schuchardt <mikes@lunarg.com> | 2018-11-08 16:44:13 -0800 |
---|---|---|
committer | Mike Schuchardt <mikes@lunarg.com> | 2018-11-09 14:40:00 -0800 |
commit | 8f733797e5de4595ada12db7078abdeebeac6c6f (patch) | |
tree | 8427bcf72c8f4613c60f0c026e8505dfc82ff109 | |
parent | f5b08a63b44c768a223516668e1c3c5683393f8b (diff) | |
download | Vulkan-Loader-8f733797e5de4595ada12db7078abdeebeac6c6f.tar.gz Vulkan-Loader-8f733797e5de4595ada12db7078abdeebeac6c6f.tar.bz2 Vulkan-Loader-8f733797e5de4595ada12db7078abdeebeac6c6f.zip |
scripts: Fix windows paths in helper.cmake
Normalize (all slashes going the same direction) and escape ("\" to "\\")
paths when writing helper.cmake. CMake was previously interpreting the
single '\' characters and whatever followed as invalid escape sequences.
Linux and macOS are unaffected.
-rwxr-xr-x | scripts/update_deps.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/update_deps.py b/scripts/update_deps.py index 119cf702..5d00eb5b 100755 --- a/scripts/update_deps.py +++ b/scripts/update_deps.py @@ -306,9 +306,9 @@ class GoodRepo(object): self.build_dir = None self.install_dir = None if json.get('build_dir'): - self.build_dir = json['build_dir'] + self.build_dir = os.path.normpath(json['build_dir']) if json.get('install_dir'): - self.install_dir = json['install_dir'] + self.install_dir = os.path.normpath(json['install_dir']) self.deps = json['deps'] if ('deps' in json) else [] self.prebuild = json['prebuild'] if ('prebuild' in json) else [] self.prebuild_linux = json['prebuild_linux'] if ( @@ -520,6 +520,8 @@ def CreateHelper(args, repos, filename): This information is baked into the CMake files of the home repo and so this dictionary is kept with the repo via the json file. """ + def escape(path): + return path.replace('\\', '\\\\') install_names = GetInstallNames(args) with open(filename, 'w') as helper_file: for repo in repos: @@ -527,7 +529,7 @@ def CreateHelper(args, repos, filename): helper_file.write('set({var} "{dir}" CACHE STRING "" FORCE)\n' .format( var=install_names[repo.name], - dir=repo.install_dir)) + dir=escape(repo.install_dir))) def main(): |