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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to