From 665ae74873949707f9a6410abf2cd27ee9e86e2c Mon Sep 17 00:00:00 2001 From: Mike Schuchardt Date: Wed, 14 Dec 2022 10:18:35 -0800 Subject: vulkaninfo: Remove macOS application bundle macOS Ventura broke the "shell script as a executable" method for delivering vulkaninfo as an .app bundle. Rather than find another workaround, we decided to remove the bundle version from the SDK since it is redundant. The command-line vulkaninfo is unaffected and can still be launched from Finder. --- BUILD.md | 6 +-- vulkaninfo/CMakeLists.txt | 5 -- vulkaninfo/macOS/Info.plist | 34 -------------- vulkaninfo/macOS/Resources/VulkanIcon.icns | Bin 157001 -> 0 bytes vulkaninfo/macOS/vulkaninfo.cmake | 73 ----------------------------- vulkaninfo/macOS/vulkaninfo.sh | 10 ---- 6 files changed, 2 insertions(+), 126 deletions(-) delete mode 100644 vulkaninfo/macOS/Info.plist delete mode 100644 vulkaninfo/macOS/Resources/VulkanIcon.icns delete mode 100644 vulkaninfo/macOS/vulkaninfo.cmake delete mode 100755 vulkaninfo/macOS/vulkaninfo.sh diff --git a/BUILD.md b/BUILD.md index 20582205..4b5eef7c 100644 --- a/BUILD.md +++ b/BUILD.md @@ -748,7 +748,6 @@ You can now run the demo applications from the command line: open cube/vkcube.app open cube/vkcubepp.app - open vulkaninfo/vulkaninfo.app Or you can locate them from `Finder` and launch them from there. @@ -788,10 +787,9 @@ run the `otool` command again from the `build/install` directory and note: The "bundle fix-up" operation also puts a copy of the Vulkan loader into the bundle, making the bundle completely self-contained and self-referencing. -##### The Non-bundled vulkaninfo Application +##### The vulkaninfo Application -There is also a non-bundled version of the `vulkaninfo` application that you -can run from the command line: +There is also a `vulkaninfo` application that you can run from the command line: vulkaninfo/vulkaninfo diff --git a/vulkaninfo/CMakeLists.txt b/vulkaninfo/CMakeLists.txt index 84eea956..69842ba5 100644 --- a/vulkaninfo/CMakeLists.txt +++ b/vulkaninfo/CMakeLists.txt @@ -104,11 +104,6 @@ endif() target_link_libraries(vulkaninfo Vulkan::Headers) -# Create vulkaninfo application bundle for MacOS -if(APPLE) - include(${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo.cmake) -endif() - if(WIN32) target_compile_definitions(vulkaninfo PUBLIC -DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -DVK_NO_PROTOTYPES) if(MSVC AND NOT MSVC_VERSION LESS 1900) diff --git a/vulkaninfo/macOS/Info.plist b/vulkaninfo/macOS/Info.plist deleted file mode 100644 index cc7b2341..00000000 --- a/vulkaninfo/macOS/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - vulkaninfo.sh - CFBundleGetInfoString - VulkanInfo - CFBundleIconFile - VulkanIcon.icns - CFBundleIdentifier - com.lunarg.vulkaninfo - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - 1.0 - CFBundleName - VulkanInfo - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - CSResourcesFileMapped - - NSHumanReadableCopyright - Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. - - diff --git a/vulkaninfo/macOS/Resources/VulkanIcon.icns b/vulkaninfo/macOS/Resources/VulkanIcon.icns deleted file mode 100644 index fb82fb7d..00000000 Binary files a/vulkaninfo/macOS/Resources/VulkanIcon.icns and /dev/null differ diff --git a/vulkaninfo/macOS/vulkaninfo.cmake b/vulkaninfo/macOS/vulkaninfo.cmake deleted file mode 100644 index 97830d0e..00000000 --- a/vulkaninfo/macOS/vulkaninfo.cmake +++ /dev/null @@ -1,73 +0,0 @@ -# ~~~ -# Copyright (c) 2018-2019 Valve Corporation -# Copyright (c) 2018-2019 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. -# ~~~ - -# Vulkaninfo Application Bundle - -# We already have a "vulkaninfo" target, so create a new target with a different name and use the OUTPUT_NAME property to rename the -# target to the desired name. The standalone binary is called "vulkaninfo" and the bundle is called "vulkaninfo.app". Note that the -# executable is a script that launches Terminal to see the output. -add_executable(vulkaninfo-bundle - MACOSX_BUNDLE - vulkaninfo.cpp - ${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json - ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo.sh - ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/VulkanIcon.icns - ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/metal_view.mm - ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo/metal_view.h) -set_target_properties(vulkaninfo-bundle - PROPERTIES OUTPUT_NAME - vulkaninfo - MACOSX_BUNDLE_INFO_PLIST - ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist) -# We do this so vulkaninfo is linked to an individual library and NOT a framework. -target_link_libraries(vulkaninfo-bundle ${Vulkan_LIBRARY} "-framework AppKit -framework QuartzCore" Vulkan::Headers) -target_include_directories(vulkaninfo-bundle PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo ${CMAKE_CURRENT_SOURCE_DIR}/generated ${CMAKE_BINARY_DIR}/vulkaninfo) -add_dependencies(vulkaninfo-bundle MoltenVK_icd-staging-json) - -set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo.sh PROPERTIES MACOSX_PACKAGE_LOCATION "MacOS") -set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/Resources/VulkanIcon.icns - PROPERTIES - MACOSX_PACKAGE_LOCATION - "Resources") -set_source_files_properties(${CMAKE_BINARY_DIR}/staging-json/MoltenVK_icd.json - PROPERTIES - MACOSX_PACKAGE_LOCATION - "Resources/vulkan/icd.d") - -# Xcode projects need some extra help with what would be install steps. -if(${CMAKE_GENERATOR} MATCHES "^Xcode.*") - add_custom_command(TARGET vulkaninfo-bundle POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" - ${CMAKE_CURRENT_BINARY_DIR}/$/vulkaninfo.app/Contents/Frameworks/libMoltenVK.dylib - DEPENDS vulkan) -else() - add_custom_command(TARGET vulkaninfo-bundle POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/MoltenVK/dylib/macOS/libMoltenVK.dylib" - ${CMAKE_CURRENT_BINARY_DIR}/vulkaninfo.app/Contents/Frameworks/libMoltenVK.dylib - DEPENDS vulkan) -endif() - -# Keep RPATH so fixup_bundle can use it to find libraries -set_target_properties(vulkaninfo-bundle PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) -install(TARGETS vulkaninfo-bundle BUNDLE DESTINATION "vulkaninfo") -# Fix up the library search path in the executable to find (loader) libraries in the bundle. When fixup_bundle() is passed a bundle -# in the first argument, it looks at the Info.plist file to determine the BundleExecutable. In this case, the executable is a -# script, which can't be fixed up. Instead pass it the explicit name of the executable. -install(CODE " - include(BundleUtilities) - fixup_bundle(\${CMAKE_INSTALL_PREFIX}/vulkaninfo/vulkaninfo.app/Contents/MacOS/vulkaninfo \"\" \"${Vulkan_LIBRARY_DIR}\") - ") diff --git a/vulkaninfo/macOS/vulkaninfo.sh b/vulkaninfo/macOS/vulkaninfo.sh deleted file mode 100755 index 0ee910e2..00000000 --- a/vulkaninfo/macOS/vulkaninfo.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -BASEDIR=`dirname $0` - -if [ -d /System/Applications/Utilities/Terminal.app ] -then - open /System/Applications/Utilities/Terminal.app $BASEDIR/vulkaninfo -else - open /Applications/Utilities/Terminal.app $BASEDIR/vulkaninfo -fi - -- cgit v1.2.3