Relax the usage of TARGET_OBJECTS generator expression

The geneator expression can now be used with static, shared, and
module libraries and executables.
This commit is contained in:
Robert Maynard
2019-04-03 14:42:35 -04:00
parent 3e129d71bc
commit ce078dda79
14 changed files with 138 additions and 19 deletions
+10
View File
@@ -62,4 +62,14 @@ add_custom_target(UseABinternalDep COMMAND ${CMAKE_COMMAND} -E touch UseABintern
add_custom_command(TARGET UseABinternal POST_BUILD COMMAND ${CMAKE_COMMAND} -P UseABinternalDep.cmake)
add_dependencies(UseABinternal UseABinternalDep)
# Test a static library with sources from a different static library
add_library(UseCstaticObjs STATIC $<TARGET_OBJECTS:Cstatic> $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:Bexport>)
# Test a shared library with sources from a different shared library
add_library(UseCsharedObjs SHARED $<TARGET_OBJECTS:Cshared> $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:Bexport>)
# Test a shared executable with sources from a different shared library
add_executable(UseABstaticObjs $<TARGET_OBJECTS:UseABstatic>)
target_link_libraries(UseABstaticObjs ABstatic)
add_subdirectory(ExportLanguages)