aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2016-06-08 12:48:18 -0600
committerMark Lobodzinski <mark@lunarg.com>2016-06-13 17:35:24 -0600
commit509c8314b1ad46c3fce73d0efa962c6f0b5ac4bd (patch)
tree6c007342f29456d328ba3d9e4a5c99550dfa60ab /layers
parentb3dd9b1367e59333e39687c838cf966cbdd7c47d (diff)
downloadusermoji-509c8314b1ad46c3fce73d0efa962c6f0b5ac4bd.tar.xz
layers: Make vklayer_utils a shared library
Was previously statically linked. Converting to a DLL will allow data sharing and use of utils in samples repo. Change-Id: I63ccc1f0f57dfad40f7068c60ac623bce5bd714d
Diffstat (limited to 'layers')
-rw-r--r--layers/CMakeLists.txt20
-rw-r--r--layers/VkLayer_utils.def45
2 files changed, 62 insertions, 3 deletions
diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt
index acf67b8a..5982cdd4 100644
--- a/layers/CMakeLists.txt
+++ b/layers/CMakeLists.txt
@@ -142,11 +142,10 @@ run_vk_layer_xml_generate(Threading thread_check.h)
run_vk_layer_generate(unique_objects unique_objects.cpp)
run_vk_layer_xml_generate(ParamChecker parameter_validation.h)
+
# Layer Utils Library
-# For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search
-# path that can't be easily modified to point it to the same directory that contains the layers.
if (WIN32)
- add_library(VkLayer_utils STATIC vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp)
+ add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp VkLayer_utils.def)
else()
add_library(VkLayer_utils SHARED vk_layer_config.cpp vk_layer_extension_utils.cpp vk_layer_utils.cpp)
install(TARGETS VkLayer_utils DESTINATION ${PROJECT_BINARY_DIR}/install_staging)
@@ -166,3 +165,18 @@ add_vk_layer(parameter_validation parameter_validation.cpp parameter_validation.
target_include_directories(VkLayer_core_validation PRIVATE ${GLSLANG_SPIRV_INCLUDE_DIR})
target_include_directories(VkLayer_core_validation PRIVATE ${SPIRV_TOOLS_INCLUDE_DIR})
target_link_libraries(VkLayer_core_validation ${SPIRV_TOOLS_LIBRARIES})
+
+if (WIN32)
+ file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/VkLayer_utils.dll COPY_SRC_PATH)
+ file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/../demos/$<CONFIGURATION>/ COPY_DST_PATH)
+ file(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/../tests/$<CONFIGURATION>/ COPY_DST_TEST_PATH)
+ # Copy layer utils library to correct locations
+ add_custom_command(TARGET VkLayer_utils
+ POST_BUILD
+ COMMAND xcopy /Y /I ${COPY_SRC_PATH} ${COPY_DST_PATH}
+ COMMENT "Copying VkLayer_utils.dll to demos dir")
+ add_custom_command(TARGET VkLayer_utils
+ POST_BUILD
+ COMMAND xcopy /Y /I ${COPY_SRC_PATH} ${COPY_DST_TEST_PATH}
+ COMMENT "Copying VkLayer_utils.dll to demos dir")
+endif()
diff --git a/layers/VkLayer_utils.def b/layers/VkLayer_utils.def
new file mode 100644
index 00000000..d2b52852
--- /dev/null
+++ b/layers/VkLayer_utils.def
@@ -0,0 +1,45 @@
+;;;; Begin Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Vulkan
+;
+; Copyright (c) 2015-2016 The Khronos Group Inc.
+; Copyright (c) 2015-2016 Valve Corporation
+; Copyright (c) 2015-2016 LunarG, Inc.
+;
+; Licensed under the Apache License, Version 2.0 (the "License");
+; you may not use this file except in compliance with the License.
+; You may obtain a copy of the License at
+;
+; http://www.apache.org/licenses/LICENSE-2.0
+;
+; Unless required by applicable law or agreed to in writing, software
+; distributed under the License is distributed on an "AS IS" BASIS,
+; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+; See the License for the specific language governing permissions and
+; limitations under the License.
+;
+; Author: Mark Lobodzinski <mark@LunarG.com>
+;;;; End Copyright Notice ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; The following is required on Windows for exporting symbols from the DLL
+
+LIBRARY VkLayer_utils
+EXPORTS
+vk_format_is_depth_or_stencil
+vk_format_is_depth_and_stencil
+vk_format_is_stencil_only
+vk_format_is_depth_only
+vk_format_is_norm
+vk_format_is_int
+vk_format_is_uint
+vk_format_is_sint
+vk_format_is_float
+vk_format_is_srgb
+vk_format_is_compressed
+vk_format_get_compatibility_class
+vk_format_get_size
+vk_format_get_channel_count
+vk_safe_modulo
+vk_string_validate
+layer_debug_actions
+util_GetExtensionProperties
+util_GetLayerProperties