mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
CMake: Transfer target_link_options from component libs to metalibs
This commit is contained in:
parent
264747d213
commit
e8f3565af2
@ -228,6 +228,7 @@ function(add_metalib target_name)
|
|||||||
set(interface_defines)
|
set(interface_defines)
|
||||||
set(includes)
|
set(includes)
|
||||||
set(libs)
|
set(libs)
|
||||||
|
set(link_options)
|
||||||
set(component_init_funcs "")
|
set(component_init_funcs "")
|
||||||
foreach(component ${components})
|
foreach(component ${components})
|
||||||
if(NOT TARGET "${component}")
|
if(NOT TARGET "${component}")
|
||||||
@ -315,6 +316,16 @@ function(add_metalib target_name)
|
|||||||
endif()
|
endif()
|
||||||
endforeach(component_library)
|
endforeach(component_library)
|
||||||
|
|
||||||
|
# All the linker options applied to an individual component get applied
|
||||||
|
# when building the metalib (for things like --exclude-libs).
|
||||||
|
get_target_property(component_link_options "${component}" LINK_OPTIONS)
|
||||||
|
foreach(component_link_option ${component_link_options})
|
||||||
|
if(component_link_option)
|
||||||
|
list(APPEND link_options "${component_link_option}")
|
||||||
|
|
||||||
|
endif()
|
||||||
|
endforeach(component_link_option)
|
||||||
|
|
||||||
# Consume this component's objects
|
# Consume this component's objects
|
||||||
list(APPEND sources "$<TARGET_OBJECTS:${component}>")
|
list(APPEND sources "$<TARGET_OBJECTS:${component}>")
|
||||||
|
|
||||||
@ -342,6 +353,7 @@ function(add_metalib target_name)
|
|||||||
PRIVATE ${private_defines}
|
PRIVATE ${private_defines}
|
||||||
INTERFACE ${interface_defines})
|
INTERFACE ${interface_defines})
|
||||||
target_link_libraries("${target_name}" ${libs})
|
target_link_libraries("${target_name}" ${libs})
|
||||||
|
target_link_options("${target_name}" PRIVATE ${link_options})
|
||||||
target_include_directories("${target_name}"
|
target_include_directories("${target_name}"
|
||||||
PUBLIC ${includes}
|
PUBLIC ${includes}
|
||||||
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/panda3d>")
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/panda3d>")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user