vulkaninfo: Remove macOS application bundle
authorMike Schuchardt <mikes@lunarg.com>
Wed, 14 Dec 2022 18:18:35 +0000 (10:18 -0800)
committerMike Schuchardt <mikes@lunarg.com>
Wed, 14 Dec 2022 22:54:56 +0000 (14:54 -0800)
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
vulkaninfo/CMakeLists.txt
vulkaninfo/macOS/Info.plist [deleted file]
vulkaninfo/macOS/Resources/VulkanIcon.icns [deleted file]
vulkaninfo/macOS/vulkaninfo.cmake [deleted file]
vulkaninfo/macOS/vulkaninfo.sh [deleted file]

index 2058220..4b5eef7 100644 (file)
--- 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
 
index 84eea95..69842ba 100644 (file)
@@ -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 (file)
index cc7b234..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>vulkaninfo.sh</string>
-       <key>CFBundleGetInfoString</key>
-       <string>VulkanInfo</string>
-       <key>CFBundleIconFile</key>
-       <string>VulkanIcon.icns</string>
-       <key>CFBundleIdentifier</key>
-       <string>com.lunarg.vulkaninfo</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleLongVersionString</key>
-       <string>1.0</string>
-       <key>CFBundleName</key>
-       <string>VulkanInfo</string>
-       <key>CFBundlePackageType</key>
-       <string>APPL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>1.0</string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>1.0</string>
-       <key>CSResourcesFileMapped</key>
-       <true/>
-       <key>NSHumanReadableCopyright</key>
-       <string>Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved.</string>
-</dict>
-</plist>
diff --git a/vulkaninfo/macOS/Resources/VulkanIcon.icns b/vulkaninfo/macOS/Resources/VulkanIcon.icns
deleted file mode 100644 (file)
index fb82fb7..0000000
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 (file)
index 97830d0..0000000
+++ /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}/$<CONFIG>/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 (executable)
index 0ee910e..0000000
+++ /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
-