Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kowalski <makowalski@nvidia.com>2022-11-08 03:37:51 +0300
committerMichael Kowalski <makowalski@nvidia.com>2022-11-08 03:37:51 +0300
commita400935d29f54b9bd821d093873eb4643a279e59 (patch)
tree5dbd37ed111ee47c0dbe5696b834c3a16e96435c /build_files/build_environment/cmake/vulkan.cmake
parent036e10e5462b95ec6a12e9dd4a900ba7ff05032c (diff)
parentd8dab1ba978e32af9af581fbd4c4bc0682278703 (diff)
Merge branch 'tmp-vfx-platform-2023' into tmp-dynamic-usdtmp-dynamic-usd
Diffstat (limited to 'build_files/build_environment/cmake/vulkan.cmake')
-rw-r--r--build_files/build_environment/cmake/vulkan.cmake55
1 files changed, 55 insertions, 0 deletions
diff --git a/build_files/build_environment/cmake/vulkan.cmake b/build_files/build_environment/cmake/vulkan.cmake
new file mode 100644
index 00000000000..1fd94dd59be
--- /dev/null
+++ b/build_files/build_environment/cmake/vulkan.cmake
@@ -0,0 +1,55 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(VULKAN_HEADERS_EXTRA_ARGS)
+
+ExternalProject_Add(external_vulkan_headers
+ URL file://${PACKAGE_DIR}/${VULKAN_HEADERS_FILE}
+ URL_HASH ${VULKAN_HEADERS_HASH_TYPE}=${VULKAN_HEADERS_HASH}
+ PREFIX ${BUILD_DIR}/vulkan_headers
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/vulkan_headers -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${VULKAN_HEADERS_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/vulkan_headers
+)
+
+set(VULKAN_LOADER_EXTRA_ARGS
+ -DVULKAN_HEADERS_INSTALL_DIR=${LIBDIR}/vulkan_headers
+)
+
+ExternalProject_Add(external_vulkan_loader
+ URL file://${PACKAGE_DIR}/${VULKAN_LOADER_FILE}
+ URL_HASH ${VULKAN_LOADER_HASH_TYPE}=${VULKAN_LOADER_HASH}
+ PREFIX ${BUILD_DIR}/vulkan_loader
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/vulkan_loader -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${VULKAN_LOADER_EXTRA_ARGS}
+ INSTALL_DIR ${LIBDIR}/vulkan_loader
+)
+
+add_dependencies(
+ external_vulkan_loader
+ external_vulkan_headers
+)
+
+if(WIN32)
+ if(BUILD_MODE STREQUAL Release)
+ ExternalProject_Add_Step(external_vulkan_loader after_install
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/vulkan_loader/ ${HARVEST_TARGET}/vulkan
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/vulkan_headers/ ${HARVEST_TARGET}/vulkan
+ DEPENDEES install
+ )
+ endif()
+endif()
+