diff options
Diffstat (limited to 'cmake/modules/TableGen.cmake')
-rw-r--r-- | cmake/modules/TableGen.cmake | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/cmake/modules/TableGen.cmake b/cmake/modules/TableGen.cmake index 34b0343..67031a5 100644 --- a/cmake/modules/TableGen.cmake +++ b/cmake/modules/TableGen.cmake @@ -70,26 +70,6 @@ function(add_public_tablegen_target target) set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${target} PARENT_SCOPE) endfunction() -if(CMAKE_CROSSCOMPILING) - set(CX_NATIVE_TG_DIR "${CMAKE_BINARY_DIR}/native") - - add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR} - COMMAND ${CMAKE_COMMAND} -E make_directory ${CX_NATIVE_TG_DIR} - COMMENT "Creating ${CX_NATIVE_TG_DIR}...") - - add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}/CMakeCache.txt - COMMAND ${CMAKE_COMMAND} -UMAKE_TOOLCHAIN_FILE -DCMAKE_BUILD_TYPE=Release - -DLLVM_BUILD_POLLY=OFF - -G "${CMAKE_GENERATOR}" ${CMAKE_SOURCE_DIR} - WORKING_DIRECTORY ${CX_NATIVE_TG_DIR} - DEPENDS ${CX_NATIVE_TG_DIR} - COMMENT "Configuring native TableGen...") - - add_custom_target(ConfigureNativeTableGen DEPENDS ${CX_NATIVE_TG_DIR}/CMakeCache.txt) - - set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CX_NATIVE_TG_DIR}) -endif() - macro(add_tablegen target project) set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS}) set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen) @@ -113,16 +93,16 @@ macro(add_tablegen target project) if(CMAKE_CROSSCOMPILING) if( ${${project}_TABLEGEN} STREQUAL "${target}" ) - set(${project}_TABLEGEN_EXE "${CX_NATIVE_TG_DIR}/bin/${target}") + set(${project}_TABLEGEN_EXE "${LLVM_NATIVE_BUILD}/bin/${target}") set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE) add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE} - COMMAND ${CMAKE_BUILD_TOOL} ${target} - DEPENDS ${CX_NATIVE_TG_DIR}/CMakeCache.txt - WORKING_DIRECTORY ${CX_NATIVE_TG_DIR} + COMMAND ${CMAKE_COMMAND} --build . --target ${target} --config $<CONFIGURATION> + DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt + WORKING_DIRECTORY ${LLVM_NATIVE_BUILD} COMMENT "Building native TableGen...") add_custom_target(${project}NativeTableGen DEPENDS ${${project}_TABLEGEN_EXE}) - add_dependencies(${project}NativeTableGen ConfigureNativeTableGen) + add_dependencies(${project}NativeTableGen ConfigureNativeLLVM) add_dependencies(${target} ${project}NativeTableGen) endif() |