Make shared library dependencies private.

By default CMake makes dependencies public, which is not what we want
for libdawn, libdawn_native and libdawn_wire
This commit is contained in:
Corentin Wallez
2018-07-30 16:25:54 +02:00
committed by Corentin Wallez
parent bdc867713a
commit 1a796039d9
3 changed files with 25 additions and 4 deletions

View File

@@ -25,6 +25,16 @@ list(APPEND UTILS_SOURCES
${UTILS_DIR}/TerribleCommandBuffer.h
)
list(APPEND UTILS_DEPS
dawn_common
libdawn_native
shaderc_shared
libdawn
glfw
)
set(UTILS_INCLUDE_DIRS)
if (DAWN_ENABLE_D3D12)
list(APPEND UTILS_SOURCES
${UTILS_DIR}/D3D12Binding.cpp
@@ -35,6 +45,10 @@ if (DAWN_ENABLE_METAL)
list(APPEND UTILS_SOURCES
${UTILS_DIR}/MetalBinding.mm
)
list(APPEND UTILS_DEPS
"-framework Metal"
"-framework QuartzCore"
)
endif()
if (DAWN_ENABLE_NULL)
@@ -47,16 +61,23 @@ if (DAWN_ENABLE_OPENGL)
list(APPEND UTILS_SOURCES
${UTILS_DIR}/OpenGLBinding.cpp
)
list(APPEND UTILS_DEPS
glad
)
endif()
if (DAWN_ENABLE_VULKAN)
list(APPEND UTILS_SOURCES
${UTILS_DIR}/VulkanBinding.cpp
)
list(APPEND UTILS_INCLUDE_DIRS
${VULKAN_HEADERS_INCLUDE_DIR}
)
endif()
add_library(utils STATIC ${UTILS_SOURCES})
target_link_libraries(utils libdawn_native shaderc_shared libdawn glfw)
target_link_libraries(utils ${UTILS_DEPS})
target_include_directories(utils PRIVATE ${UTILS_INCLUDE_DIRS})
DawnInternalTarget("" utils)
if(NOT MSVC)
# allow C-style casts -- for shaderc