diff options
Diffstat (limited to 'gn/gn_to_cmake.py')
-rw-r--r-- | gn/gn_to_cmake.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gn/gn_to_cmake.py b/gn/gn_to_cmake.py index 0e82d64c9f..eca4c07584 100644 --- a/gn/gn_to_cmake.py +++ b/gn/gn_to_cmake.py @@ -624,12 +624,13 @@ def WriteTarget(out, target, project): def WriteProject(project): out = open(posixpath.join(project.build_path, 'CMakeLists.txt'), 'w+') + extName = posixpath.join(project.build_path, 'CMakeLists.ext') out.write('# Generated by gn_to_cmake.py.\n') out.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n') out.write('cmake_policy(VERSION 2.8.8)\n\n') out.write('file(WRITE "') - out.write(posixpath.join(project.build_path, "empty.cpp")) + out.write(CMakeStringEscape(posixpath.join(project.build_path, "empty.cpp"))) out.write('")\n') # Update the gn generated ninja build. @@ -640,10 +641,12 @@ def WriteProject(project): out.write(CMakeStringEscape(project.build_path)) out.write('" build.ninja)\n') - out.write('include(CMakeLists.ext)\n') + out.write('include("') + out.write(CMakeStringEscape(extName)) + out.write('")\n') out.close() - out = open(posixpath.join(project.build_path, 'CMakeLists.ext'), 'w+') + out = open(extName, 'w+') out.write('# Generated by gn_to_cmake.py.\n') out.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n') out.write('cmake_policy(VERSION 2.8.8)\n') |