[llvm-commits] [llvm] r144873 - /llvm/trunk/utils/llvm-build/llvmbuild/main.py

Daniel Dunbar daniel at zuster.org
Wed Nov 16 17:19:54 PST 2011


Author: ddunbar
Date: Wed Nov 16 19:19:53 2011
New Revision: 144873

URL: http://llvm.org/viewvc/llvm-project?rev=144873&view=rev
Log:
llvm-build: Attempt to work around a CMake Makefile generator bug that doesn't
properly quote strings when writing the CMakeFiles/Makefile.cmake output file
(which lists the dependencies). This shows up when using CMake + MSYS Makefile
generator.

Modified:
    llvm/trunk/utils/llvm-build/llvmbuild/main.py

Modified: llvm/trunk/utils/llvm-build/llvmbuild/main.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/llvm-build/llvmbuild/main.py?rev=144873&r1=144872&r2=144873&view=diff
==============================================================================
--- llvm/trunk/utils/llvm-build/llvmbuild/main.py (original)
+++ llvm/trunk/utils/llvm-build/llvmbuild/main.py Wed Nov 16 19:19:53 2011
@@ -21,6 +21,21 @@
 
     return value
 
+def cmake_quote_path(value):
+    """
+    cmake_quote_path(value) -> str
+
+    Return a quoted form of the given value that is suitable for use in CMake
+    language files.
+    """
+
+    # CMake has a bug in it's Makefile generator that doesn't properly quote
+    # strings it generates. So instead of using proper quoting, we just use "/"
+    # style paths.  Currently, we only handle escaping backslashes.
+    value = value.replace("\\", "/")
+
+    return value
+
 def mk_quote_string_for_target(value):
     """
     mk_quote_string_for_target(target_name) -> str
@@ -430,7 +445,7 @@
             print >>f, """\
 configure_file(\"%s\"
                ${CMAKE_CURRENT_BINARY_DIR}/DummyConfigureOutput)""" % (
-                cmake_quote_string(dep),)
+                cmake_quote_path(dep),)
 
         f.close()
 





More information about the llvm-commits mailing list