mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-05 03:46:27 +00:00
317e76f08d
The rational for this change is that LLVMBuild cannot express conditional dependencies. Therefore, when we start optionally using GlobalISel library for say AArch64, without that change, all the tools that use the AArch64 library would need to explicitly link with GlobalISel when we ask for it. This does not scale. Instead, we will set the dependencies between the target and GlobalISel and if we did not ask to build GlobalISel, the library will just be empty. Thanks to Chris Bieneman and Mehdi Animi for the idea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260566 91177308-0d34-0410-b5e6-96231b3b80d8
25 lines
684 B
CMake
25 lines
684 B
CMake
# List of all GlobalISel files.
|
|
set(GLOBAL_ISEL_FILES
|
|
IRTranslator.cpp
|
|
MachineIRBuilder.cpp
|
|
)
|
|
|
|
# Add GlobalISel files to the dependencies if the user wants to build it.
|
|
if(LLVM_BUILD_GLOBAL_ISEL)
|
|
set(GLOBAL_ISEL_BUILD_FILES ${GLOBAL_ISEL_FILES})
|
|
else()
|
|
set(GLOBAL_ISEL_BUILD_FILES"")
|
|
set(LLVM_OPTIONAL_SOURCES LLVMGlobalISel ${GLOBAL_ISEL_FILES})
|
|
endif()
|
|
|
|
|
|
# In LLVMBuild.txt files, it is not possible to mark a dependency to a
|
|
# library as optional. So instead, generate an empty library if we did
|
|
# not ask for it.
|
|
add_llvm_library(LLVMGlobalISel
|
|
${GLOBAL_ISEL_BUILD_FILES}
|
|
EmptyFile.cpp
|
|
)
|
|
|
|
add_dependencies(LLVMGlobalISel intrinsics_gen)
|