forked from OSchip/llvm-project
CMake: Fixed parallel build problem related to native tblgen when
cross-compiling. llvm-svn: 73180
This commit is contained in:
parent
dd49ee3fb4
commit
caa7a94f66
|
@ -222,6 +222,8 @@ set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
|
||||||
|
|
||||||
set(LLVM_TABLEGEN "tblgen" CACHE
|
set(LLVM_TABLEGEN "tblgen" CACHE
|
||||||
STRING "Native TableGen executable. Saves building one when cross-compiling.")
|
STRING "Native TableGen executable. Saves building one when cross-compiling.")
|
||||||
|
# Effective tblgen executable to be used:
|
||||||
|
set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
|
||||||
|
|
||||||
add_subdirectory(utils/TableGen)
|
add_subdirectory(utils/TableGen)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
|
if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
|
||||||
set(CX_NATIVE_TG_DIR "${CMAKE_BINARY_DIR}/native")
|
set(CX_NATIVE_TG_DIR "${CMAKE_BINARY_DIR}/native")
|
||||||
set(LLVM_TABLEGEN "${CX_NATIVE_TG_DIR}/bin/tblgen")
|
set(LLVM_TABLEGEN_EXE "${CX_NATIVE_TG_DIR}/bin/tblgen")
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}
|
add_custom_command(OUTPUT ${CX_NATIVE_TG_DIR}
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CX_NATIVE_TG_DIR}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CX_NATIVE_TG_DIR}
|
||||||
|
@ -13,12 +13,12 @@ if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
|
||||||
DEPENDS ${CX_NATIVE_TG_DIR}
|
DEPENDS ${CX_NATIVE_TG_DIR}
|
||||||
COMMENT "Configuring native TableGen...")
|
COMMENT "Configuring native TableGen...")
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${LLVM_TABLEGEN}
|
add_custom_command(OUTPUT ${LLVM_TABLEGEN_EXE}
|
||||||
COMMAND ${CMAKE_BUILD_TOOL}
|
COMMAND ${CMAKE_BUILD_TOOL}
|
||||||
DEPENDS ${CX_NATIVE_TG_DIR}/CMakeCache.txt
|
DEPENDS ${CX_NATIVE_TG_DIR}/CMakeCache.txt
|
||||||
WORKING_DIRECTORY ${CX_NATIVE_TG_DIR}/utils/TableGen
|
WORKING_DIRECTORY ${CX_NATIVE_TG_DIR}/utils/TableGen
|
||||||
COMMENT "Building native TableGen...")
|
COMMENT "Building native TableGen...")
|
||||||
add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN})
|
add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN_EXE})
|
||||||
|
|
||||||
add_dependencies(tblgen NativeTableGen)
|
add_dependencies(tblgen NativeTableGen)
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ macro(tablegen ofn)
|
||||||
file(GLOB all_tds "*.td")
|
file(GLOB all_tds "*.td")
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||||
COMMAND ${LLVM_TABLEGEN} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
|
COMMAND ${LLVM_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
-I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
|
-I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
|
${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
|
||||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||||
DEPENDS ${LLVM_TABLEGEN} ${all_tds}
|
DEPENDS tblgen ${all_tds}
|
||||||
COMMENT "Building ${ofn}.tmp..."
|
COMMENT "Building ${ofn}.tmp..."
|
||||||
)
|
)
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||||
|
|
Loading…
Reference in New Issue