Escape a path to be used in a ninja file.
(path)
| 183 | |
| 184 | |
| 185 | def escape_ninja_path(path): |
| 186 | """Escape a path to be used in a ninja file.""" |
| 187 | # Replace Windows backslashes with forward slashes. |
| 188 | path = path.replace('\\', '/') |
| 189 | # Escape special Ninja chars. |
| 190 | return re.sub(r'([ :$])', r'$\1', path) |
| 191 | |
| 192 | |
| 193 | def create_ninja_file(input_files, filename, libname, cflags, asflags=None, customize_build_flags=None): |