mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
CMake: Fixed parallel build problem related to native tblgen when
cross-compiling. llvm-svn: 73180
This commit is contained in:
parent
c2d42ced17
commit
cfe2266e89
@ -222,6 +222,8 @@ set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${LLVM_LIBS} )
|
||||
|
||||
set(LLVM_TABLEGEN "tblgen" CACHE
|
||||
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)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
|
||||
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}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CX_NATIVE_TG_DIR}
|
||||
@ -13,12 +13,12 @@ if( ${LLVM_TABLEGEN} STREQUAL "tblgen" )
|
||||
DEPENDS ${CX_NATIVE_TG_DIR}
|
||||
COMMENT "Configuring native TableGen...")
|
||||
|
||||
add_custom_command(OUTPUT ${LLVM_TABLEGEN}
|
||||
add_custom_command(OUTPUT ${LLVM_TABLEGEN_EXE}
|
||||
COMMAND ${CMAKE_BUILD_TOOL}
|
||||
DEPENDS ${CX_NATIVE_TG_DIR}/CMakeCache.txt
|
||||
WORKING_DIRECTORY ${CX_NATIVE_TG_DIR}/utils/TableGen
|
||||
COMMENT "Building native TableGen...")
|
||||
add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN})
|
||||
add_custom_target(NativeTableGen DEPENDS ${LLVM_TABLEGEN_EXE})
|
||||
|
||||
add_dependencies(tblgen NativeTableGen)
|
||||
|
||||
|
@ -6,11 +6,11 @@ macro(tablegen ofn)
|
||||
file(GLOB all_tds "*.td")
|
||||
|
||||
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}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
|
||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
|
||||
DEPENDS ${LLVM_TABLEGEN} ${all_tds}
|
||||
DEPENDS tblgen ${all_tds}
|
||||
COMMENT "Building ${ofn}.tmp..."
|
||||
)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
|
||||
|
Loading…
Reference in New Issue
Block a user