Merge branch 'master' of ssh://github.com/86Box/86Box
This commit is contained in:
@@ -165,6 +165,9 @@ cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)"
|
|||||||
# Ditto but for Qt
|
# Ditto but for Qt
|
||||||
if(QT)
|
if(QT)
|
||||||
option(USE_QT6 "Use Qt6 instead of Qt5" OFF)
|
option(USE_QT6 "Use Qt6 instead of Qt5" OFF)
|
||||||
|
if(APPLE)
|
||||||
|
option(MOLTENVK "Use MoltenVK libraries for Vulkan support on macOS. Requires a Vulkan-enabled QT." OFF)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Determine the build type
|
# Determine the build type
|
||||||
|
@@ -14,6 +14,9 @@
|
|||||||
# Copyright 2020-2022 David Hrdlička.
|
# Copyright 2020-2022 David Hrdlička.
|
||||||
# Copyright 2021 dob205.
|
# Copyright 2021 dob205.
|
||||||
#
|
#
|
||||||
|
if(APPLE)
|
||||||
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(86Box 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
|
add_executable(86Box 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
|
||||||
dma.c ddma.c discord.c nmi.c pic.c pit.c pit_fast.c port_6x.c port_92.c ppi.c pci.c
|
dma.c ddma.c discord.c nmi.c pic.c pit.c pit_fast.c port_6x.c port_92.c ppi.c pci.c
|
||||||
@@ -83,11 +86,16 @@ if(APPLE)
|
|||||||
# Force using the newest library if it's installed by homebrew
|
# Force using the newest library if it's installed by homebrew
|
||||||
set(CMAKE_FIND_FRAMEWORK LAST)
|
set(CMAKE_FIND_FRAMEWORK LAST)
|
||||||
|
|
||||||
# setting our compilation target to macOS 10.15 Catalina if targetting Qt6, macOS 10.13 High Sierra otherwise
|
# setting our compilation target to macOS 10.15 Catalina if targeting Qt6,
|
||||||
|
# macOS 10.14 Mojave for vulkan support, 10.13 High Sierra otherwise
|
||||||
if (USE_QT6)
|
if (USE_QT6)
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
|
if(MOLTENVK)
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
|
||||||
|
else()
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -209,6 +209,18 @@ endif()
|
|||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
target_sources(ui PRIVATE macos_event_filter.mm)
|
target_sources(ui PRIVATE macos_event_filter.mm)
|
||||||
|
if(MOLTENVK)
|
||||||
|
find_path(MOLTENVK_INCLUDE "vulkan/vulkan.h" PATHS "/opt/homebrew/opt/molten-vk/libexec/include" "/usr/local/opt/molten-vk/libexec/include" ${MOLTENVK_INCLUDE_DIR})
|
||||||
|
if (NOT MOLTENVK_INCLUDE)
|
||||||
|
message(FATAL_ERROR "Could not find vulkan/vulkan.h. If the headers are installed please use -DMOLTENVK_INCLUDE_DIR=/path/to/headers")
|
||||||
|
endif()
|
||||||
|
target_include_directories(ui PRIVATE ${MOLTENVK_INCLUDE})
|
||||||
|
find_library(MOLTENVK_LIB MoltenVK)
|
||||||
|
if (NOT MOLTENVK_LIB)
|
||||||
|
message(FATAL_ERROR "Could not find MoltenVK library")
|
||||||
|
endif()
|
||||||
|
target_link_libraries(ui PRIVATE "${MOLTENVK_LIB}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
@@ -285,6 +297,7 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE)
|
|||||||
set(prefix "86Box.app/Contents")
|
set(prefix "86Box.app/Contents")
|
||||||
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
|
set(INSTALL_RUNTIME_DIR "${prefix}/MacOS")
|
||||||
set(INSTALL_CMAKE_DIR "${prefix}/Resources")
|
set(INSTALL_CMAKE_DIR "${prefix}/Resources")
|
||||||
|
set(INSTALL_LIB_DIR "${prefix}/Frameworks")
|
||||||
|
|
||||||
# using the install_qt5_plugin to add Qt plugins into the macOS app bundle
|
# using the install_qt5_plugin to add Qt plugins into the macOS app bundle
|
||||||
install_qt5_plugin("Qt${QT_MAJOR}::QCocoaIntegrationPlugin" QT_PLUGINS ${prefix})
|
install_qt5_plugin("Qt${QT_MAJOR}::QCocoaIntegrationPlugin" QT_PLUGINS ${prefix})
|
||||||
@@ -317,6 +330,16 @@ if (APPLE AND CMAKE_MACOSX_BUNDLE)
|
|||||||
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\"
|
COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\"
|
||||||
\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/${INSTALL_RUNTIME_DIR}/86Box\")
|
\"\${CMAKE_INSTALL_PREFIX_ABSOLUTE}/${INSTALL_RUNTIME_DIR}/86Box\")
|
||||||
")
|
")
|
||||||
|
if(MOLTENVK)
|
||||||
|
install(CODE "
|
||||||
|
execute_process(
|
||||||
|
COMMAND bash -c \"set -e
|
||||||
|
echo \\\"-- Creating vulkan dylib symlink for QT (libVulkan.dylib -> libMoltenVK.dylib)\\\"
|
||||||
|
cd \${CMAKE_INSTALL_PREFIX_ABSOLUTE}/${INSTALL_LIB_DIR}
|
||||||
|
ln -sf libMoltenVK.dylib libVulkan.dylib
|
||||||
|
\")
|
||||||
|
")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND NOT HAIKU)
|
if (UNIX AND NOT APPLE AND NOT HAIKU)
|
||||||
|
Reference in New Issue
Block a user