Skip to content

Commit 3ee8dab

Browse files
committed
[CMake] Fix for llvm#144598: Move LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS backwards
`LLVM_ENABLE_PLUGINS` is not set on the fresh run.
1 parent cca44e0 commit 3ee8dab

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -942,13 +942,6 @@ if (LLVM_LINK_LLVM_DYLIB AND BUILD_SHARED_LIBS)
942942
message(FATAL_ERROR "Cannot enable BUILD_SHARED_LIBS with LLVM_LINK_LLVM_DYLIB. We recommend disabling BUILD_SHARED_LIBS.")
943943
endif()
944944

945-
set(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS OFF)
946-
if (LLVM_BUILD_LLVM_DYLIB OR LLVM_BUILD_SHARED_LIBS OR LLVM_ENABLE_PLUGINS)
947-
# Export annotations for LLVM must be enabled if building as a shared lib or
948-
# enabling plugins.
949-
set(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS ON)
950-
endif()
951-
952945
option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF)
953946
if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS OR CMAKE_CONFIGURATION_TYPES)))
954947
set(LLVM_USE_HOST_TOOLS ON)
@@ -1063,6 +1056,13 @@ else()
10631056
endif()
10641057
option(LLVM_ENABLE_PLUGINS "Enable plugin support" ${LLVM_ENABLE_PLUGINS_default})
10651058

1059+
set(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS OFF)
1060+
if (LLVM_BUILD_LLVM_DYLIB OR LLVM_BUILD_SHARED_LIBS OR LLVM_ENABLE_PLUGINS)
1061+
# Export annotations for LLVM must be enabled if building as a shared lib or
1062+
# enabling plugins.
1063+
set(LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS ON)
1064+
endif()
1065+
10661066
set(LLVM_ENABLE_NEW_PASS_MANAGER TRUE CACHE BOOL
10671067
"Enable the new pass manager by default.")
10681068
if(NOT LLVM_ENABLE_NEW_PASS_MANAGER)

0 commit comments

Comments
 (0)