mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 08:06:19 +00:00
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:
committed by
Corentin Wallez
parent
bdc867713a
commit
1a796039d9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user