build: tweak gyb line directives

Make the quoted parameters more portable.  This is needed in order to
support building swift on Windows.  Simplify the declaration of the
flags and do a small formatting clean up.  This ensures that the ninja
generation gets the command line invocation correct.
This commit is contained in:
Saleem Abdulrasool
2018-02-28 22:45:56 -08:00
parent 34e77c0f25
commit 2e77e6a8b1
3 changed files with 12 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
set(line_directive "#line" "%(line)d" "\"%(file)s\"")
set(SWIFT_GYB_FLAGS
--line-directive "'${line_directive}'")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
set(SWIFT_GYB_FLAGS --line-directive "^\"#line %(line)d \\\"%(file)s\\\"^\"")
else()
set(SWIFT_GYB_FLAGS --line-directive "\'#line" "%(line)d" "\"%(file)s\"\'")
endif()
set(generated_include_sources
SyntaxKind.h.gyb