[LLVMbugs] [Bug 15615] New: Crosscompiling TableGen with CMake does not work with a non-default generator

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 28 04:24:25 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15615

            Bug ID: 15615
           Summary: Crosscompiling TableGen with CMake does not work with
                    a non-default generator
           Product: tools
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: unassignedbugs at nondot.org
          Reporter: vslugovsky at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

When running CMake for the native TableGen in a cross-compiled environment, a
default generator is used. If it does not match the generator used by the cross
cmake, build will fail (confirmed with Ninja generator).

A fix is trivial:

diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake
index e3bdd9c..944394f 100644
--- a/cmake/modules/TableGen.cmake
+++ b/cmake/modules/TableGen.cmake
@@ -67,6 +67,7 @@ if(CMAKE_CROSSCOMPILING)
   add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}/CMakeCache.txt
     COMMAND ${CMAKE_COMMAND} -UMAKE_TOOLCHAIN_FILE -DCMAKE_BUILD_TYPE=Release
                              -DLLVM_BUILD_POLLY=OFF ${CMAKE_SOURCE_DIR}
+                             -G${CMAKE_GENERATOR}
     WORKING_DIRECTORY ${CX_NATIVE_TG_DIR}
     DEPENDS ${CX_NATIVE_TG_DIR}
     COMMENT "Configuring native TableGen...")

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130328/4f5277cc/attachment.html>


More information about the llvm-bugs mailing list