[WebAssembly] Add new target feature in support of 'extended-const' proposal
[llvm-project.git] / llvm / lib / Target / CMakeLists.txt
blob35a8e9ae0f708faf856fbfcfe1a7d87c06f85d81
1 list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen)
3 list(APPEND LLVM_TABLEGEN_FLAGS -I ${LLVM_MAIN_SRC_DIR}/lib/Target)
5 add_llvm_component_library(LLVMTarget
6   Target.cpp
7   TargetIntrinsicInfo.cpp
8   TargetLoweringObjectFile.cpp
9   TargetMachine.cpp
10   TargetMachineC.cpp
12   ADDITIONAL_HEADER_DIRS
13   ${LLVM_MAIN_INCLUDE_DIR}/llvm/Target
15   LINK_COMPONENTS
16   Analysis
17   Core
18   MC
19   Support
20   )
22 # When building shared objects for each target there are some internal APIs
23 # that are used across shared objects which we can't hide.
24 if (NOT BUILD_SHARED_LIBS AND NOT APPLE AND
25     NOT (${CMAKE_SYSTEM_NAME} MATCHES "AIX") AND
26     NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET)
27   # Set default visibility to hidden, so we don't export all the Target classes
28   # in libLLVM.so.
29   set(CMAKE_CXX_VISIBILITY_PRESET hidden)
30 endif()
32 foreach(t ${LLVM_TARGETS_TO_BUILD})
33   message(STATUS "Targeting ${t}")
34   add_subdirectory(${t})
35 endforeach()
37 # Currently we do not allow libraries from lib to reference targets directly.
38 # This property is used to enforce that convention. It is important because the
39 # logic in llvm_map_components_to_libnames is order dependent on the target
40 # libraries being created.
41 set_property(GLOBAL PROPERTY LLVM_TARGETS_CONFIGURED On)