Skip to content

Commit

Permalink
using PUBLIC + BUILD_INTERFACE to express transitive deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugobros3 committed Oct 22, 2023
1 parent 83f31e6 commit 4cb796d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
add_library(driver STATIC driver.c cli.c)
target_link_libraries(driver PRIVATE shady common)
target_link_libraries(driver PUBLIC "$<BUILD_INTERFACE:shady>")
set_property(TARGET driver PROPERTY POSITION_INDEPENDENT_CODE ON)

add_executable(slim slim.c)
target_link_libraries(slim PRIVATE driver api common)
target_link_libraries(slim PRIVATE driver)

if (TARGET shady_s2s)
target_compile_definitions(driver PUBLIC SPV_PARSER_PRESENT)
Expand All @@ -15,6 +15,5 @@ if (TARGET shady_fe_llvm)
target_compile_definitions(driver PUBLIC LLVM_PARSER_PRESENT)

add_executable(vcc vcc.c)
target_compile_definitions(vcc PRIVATE "VCC=1")
target_link_libraries(vcc PRIVATE driver api common)
endif ()
6 changes: 3 additions & 3 deletions src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
add_library(runtime SHARED runtime.c runtime_program.c)
target_link_libraries(runtime PUBLIC api shady)
target_link_libraries(runtime PRIVATE common driver)
target_link_libraries(runtime PUBLIC shady)
target_link_libraries(runtime PUBLIC "$<BUILD_INTERFACE:driver>")
set_property(TARGET runtime PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(runtime PROPERTIES OUTPUT_NAME "shady_runtime")

add_subdirectory(vulkan)

add_executable(runtime_test runtime_test.c)
target_link_libraries(runtime_test common shady runtime driver)
target_link_libraries(runtime_test runtime)
2 changes: 1 addition & 1 deletion src/shady/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ add_subdirectory(internal)
add_subdirectory(emit)

target_link_libraries(shady PUBLIC "api")
target_link_libraries(shady PRIVATE "$<BUILD_INTERFACE:common>")
target_link_libraries(shady PUBLIC "$<BUILD_INTERFACE:common>")
target_link_libraries(shady PRIVATE "$<BUILD_INTERFACE:SPIRV-Headers::SPIRV-Headers>")

0 comments on commit 4cb796d

Please sign in to comment.