diff options
Diffstat (limited to 'llvm/lib/Target/CMakeLists.txt')
| -rw-r--r-- | llvm/lib/Target/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/CMakeLists.txt b/llvm/lib/Target/CMakeLists.txt index 1e6abfacb79..5256b913144 100644 --- a/llvm/lib/Target/CMakeLists.txt +++ b/llvm/lib/Target/CMakeLists.txt @@ -13,6 +13,14 @@ add_llvm_library(LLVMTarget ${LLVM_MAIN_INCLUDE_DIR}/llvm/Target ) +# When building shared objects for each target there are some internal APIs +# that are used across shared objects which we can't hide. +if (NOT BUILD_SHARED_LIBS) + # Set default visibility to hidden, so we don't export all the Target classes + # in libLLVM.so. + set(CMAKE_CXX_VISIBILITY_PRESET hidden) +endif() + foreach(t ${LLVM_TARGETS_TO_BUILD}) message(STATUS "Targeting ${t}") add_subdirectory(${t}) |

