diff options
Diffstat (limited to 'cmake/SlangTarget.cmake')
| -rw-r--r-- | cmake/SlangTarget.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake index e370a4987..5387cd2ce 100644 --- a/cmake/SlangTarget.cmake +++ b/cmake/SlangTarget.cmake @@ -55,10 +55,16 @@ function(slang_add_target dir type) EXTRA_COMPILE_OPTIONS_PRIVATE # Targets with which to link privately LINK_WITH_PRIVATE + # Targets with which to link publicly, for example if their headers + # appear in our headers + LINK_WITH_PUBLIC # Frameworks with which to link privately LINK_WITH_FRAMEWORK # Targets whose headers we use, but don't link with INCLUDE_FROM_PRIVATE + # Targets whose headers we use in our headers, so need to make sure + # dependencies of this target also include them + INCLUDE_FROM_PUBLIC # Any include directories other targets need to use this target INCLUDE_DIRECTORIES_PUBLIC # Any include directories this target only needs @@ -214,6 +220,7 @@ function(slang_add_target dir type) # Link and include from dependencies # target_link_libraries(${target} PRIVATE ${ARG_LINK_WITH_PRIVATE}) + target_link_libraries(${target} PUBLIC ${ARG_LINK_WITH_PUBLIC}) if(CMAKE_SYSTEM_NAME MATCHES "Darwin") foreach(link_framework ${ARG_LINK_WITH_FRAMEWORK}) @@ -228,6 +235,13 @@ function(slang_add_target dir type) $<TARGET_PROPERTY:${include_from},INTERFACE_INCLUDE_DIRECTORIES> ) endforeach() + foreach(include_from ${ARG_INCLUDE_FROM_PUBLIC}) + target_include_directories( + ${target} + PUBLIC + $<TARGET_PROPERTY:${include_from},INTERFACE_INCLUDE_DIRECTORIES> + ) + endforeach() # # Set our exported include directories |
