Skip to content

Commit 471d804

Browse files
authored
[CMake][unittests] Teach export_executable_symbols about ALIAS targets (#167932)
DynamicLibraryTests has a workaround for AIX that calls export_executable_symbols after add_llvm_unittest, instead of just passing the `EXPORT_SYMBOLS` switch. At this point, the default_gtest(_main) libraries is added to the linked library set. However, default_gtest(_main) are ALIAS libraries. This PR replaces the ALIAS libraries with the ALIASED_TARGET before passing it to extract_symbols.py. Fixes failure of the clang-ppc64-aix buildbot after #164794.
1 parent 5385f41 commit 471d804

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,14 @@ function(export_executable_symbols target)
13591359
while(NOT "${new_libs}" STREQUAL "")
13601360
foreach(lib ${new_libs})
13611361
if(TARGET ${lib})
1362+
# If this is a ALIAS target, continue with its aliasee instead.
1363+
get_target_property(aliased_lib ${lib} ALIASED_TARGET)
1364+
if(aliased_lib)
1365+
set(new_libs ${lib_aliased_target})
1366+
list(APPEND newer_libs ${aliased_lib})
1367+
continue()
1368+
endif()
1369+
13621370
get_target_property(lib_type ${lib} TYPE)
13631371
if("${lib_type}" STREQUAL "STATIC_LIBRARY")
13641372
list(APPEND static_libs ${lib})

0 commit comments

Comments
 (0)