Skip to content

Commit e497fbf

Browse files
bradkingkwrobot
authored andcommitted
Merge topic 'Apple-TBD-in-subdirecory' into release-3.29
bcc26ce Apple Text Based Stubs: should be usage in subdirectories Acked-by: Kitware Robot <[email protected]> Acked-by: buildbot <[email protected]> Merge-request: !9341
2 parents 3e90c88 + bcc26ce commit e497fbf

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

Source/cmMakefileLibraryTargetGenerator.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
978978
auto genStubsRule =
979979
this->Makefile->GetDefinition("CMAKE_CREATE_TEXT_STUBS");
980980
cmList genStubs_commands{ genStubsRule };
981+
this->LocalGenerator->CreateCDCommand(
982+
genStubs_commands, this->Makefile->GetCurrentBinaryDirectory(),
983+
this->LocalGenerator->GetBinaryDirectory());
981984

982985
std::string TBDFullPath =
983986
cmStrCat(outpathImp, this->TargetNames.ImportOutput);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
add_library(foo2 SHARED ../foo.c)
3+
set_property(TARGET foo2 PROPERTY ENABLE_EXPORTS TRUE)
4+
5+
install(TARGETS foo2 DESTINATION "${CMAKE_BINARY_DIR}/INSTALL")

Tests/RunCMake/AppleTextStubs/Simple.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set_property(TARGET foo PROPERTY ENABLE_EXPORTS TRUE)
66
add_executable(main main.c)
77
target_link_libraries(main PRIVATE foo)
88

9+
add_subdirectory(SUBDIR)
910

1011
install(TARGETS foo DESTINATION "${CMAKE_BINARY_DIR}/INSTALL")
1112

@@ -24,15 +25,20 @@ macro (CHECK_FILE test_msg path)
2425
endif()
2526
endmacro()
2627

27-
check_file("DYLIB file" "$<TARGET_FILE:foo>")
28+
check_file("foo DYLIB file" "$<TARGET_FILE:foo>")
29+
check_file("foo2 DYLIB file" "$<TARGET_FILE:foo2>")
2830
check_file("executable file" "$<TARGET_FILE:main>")
2931

32+
check_file("Installed foo DYLIB file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_FILE_NAME:foo>")
33+
check_file("Installed foo2 DYLIB file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_FILE_NAME:foo2>")
3034
check_file("Installed DYLIB file" "${RunCMake_TEST_BINARY_DIR}/INSTALL2/lib/$<TARGET_FILE_NAME:foo>")
3135

3236
if (APPLE_TEXT_STUBS_SUPPORTED)
33-
check_file("TBD file" "$<TARGET_IMPORT_FILE:foo>")
37+
check_file("foo TBD file" "$<TARGET_IMPORT_FILE:foo>")
38+
check_file("foo2 TBD file" "$<TARGET_IMPORT_FILE:foo2>")
3439

35-
check_file("Installed TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_IMPORT_FILE_NAME:foo>")
40+
check_file("Installed foo TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_IMPORT_FILE_NAME:foo>")
41+
check_file("Installed foo2 TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL/$<TARGET_IMPORT_FILE_NAME:foo2>")
3642
check_file("Installed TBD file" "${RunCMake_TEST_BINARY_DIR}/INSTALL2/dev/$<TARGET_IMPORT_FILE_NAME:foo>")
3743
endif()
3844
]])

0 commit comments

Comments
 (0)