Compare commits

..

No commits in common. "f7a89621944076ed9b2187680b05413d36ca758d" and "ecdf7d736fac5c0709341df3f2862b9a86db530d" have entirely different histories.

10 changed files with 95 additions and 168 deletions

View File

@ -16,8 +16,6 @@
# components, which are: # components, which are:
# #
# Containers - Containers library # Containers - Containers library
# Interconnect - Interconnect library
# Main - Main library
# PluginManager - PluginManager library # PluginManager - PluginManager library
# TestSuite - TestSuite library # TestSuite - TestSuite library
# Utility - Utility library # Utility - Utility library
@ -70,7 +68,7 @@
# mode for MSVC 2017 # mode for MSVC 2017
# CORRADE_MSVC2015_COMPATIBILITY - Defined if compiled with compatibility # CORRADE_MSVC2015_COMPATIBILITY - Defined if compiled with compatibility
# mode for MSVC 2015 # mode for MSVC 2015
# CORRADE_BUILD_DEPRECATED - Defined if compiled with deprecated features # CORRADE_BUILD_DEPRECATED - Defined if compiled with deprecated APIs
# included # included
# CORRADE_BUILD_STATIC - Defined if compiled as static libraries. # CORRADE_BUILD_STATIC - Defined if compiled as static libraries.
# Default are shared libraries. # Default are shared libraries.
@ -80,9 +78,6 @@
# CORRADE_BUILD_MULTITHREADED - Defined if compiled in a way that makes it # CORRADE_BUILD_MULTITHREADED - Defined if compiled in a way that makes it
# possible to safely use certain Corrade features simultaneously in multiple # possible to safely use certain Corrade features simultaneously in multiple
# threads # threads
# CORRADE_BUILD_CPU_RUNTIME_DISPATCH - Defined if built with code paths
# optimized for multiple architectres with the best matching variant selected
# at runtime based on detected CPU features
# CORRADE_TARGET_UNIX - Defined if compiled for some Unix flavor # CORRADE_TARGET_UNIX - Defined if compiled for some Unix flavor
# (Linux, BSD, macOS) # (Linux, BSD, macOS)
# CORRADE_TARGET_APPLE - Defined if compiled for Apple platforms # CORRADE_TARGET_APPLE - Defined if compiled for Apple platforms
@ -103,8 +98,6 @@
# CORRADE_TARGET_MSVC - Defined if compiling with MSVC or Clang with # CORRADE_TARGET_MSVC - Defined if compiling with MSVC or Clang with
# a MSVC frontend # a MSVC frontend
# CORRADE_TARGET_MINGW - Defined if compiling under MinGW # CORRADE_TARGET_MINGW - Defined if compiling under MinGW
# CORRADE_CPU_USE_IFUNC - Defined if GNU IFUNC is allowed to be used
# for runtime dispatch in the Cpu library
# CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT - Defined if PluginManager # CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT - Defined if PluginManager
# doesn't support dynamic plugin loading due to platform limitations # doesn't support dynamic plugin loading due to platform limitations
# CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targeting Xcode # CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targeting Xcode
@ -215,7 +208,7 @@
# <metadata file> # <metadata file>
# <sources>...) # <sources>...)
# #
# Unlike the above version this puts everything into ``<debug install dir>`` on # Unline the above version this puts everything into ``<debug install dir>`` on
# both DLL and non-DLL platforms. If ``<debug install dir>`` is set to # both DLL and non-DLL platforms. If ``<debug install dir>`` is set to
# :variable:`CMAKE_CURRENT_BINARY_DIR` (e.g. for testing purposes), the files # :variable:`CMAKE_CURRENT_BINARY_DIR` (e.g. for testing purposes), the files
# are copied directly, without the need to perform install step. Note that the # are copied directly, without the need to perform install step. Note that the
@ -271,7 +264,7 @@
# This file is part of Corrade. # This file is part of Corrade.
# #
# Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, # Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016,
# 2017, 2018, 2019, 2020, 2021, 2022, 2023 # 2017, 2018, 2019, 2020, 2021, 2022
# Vladimír Vondruš <mosra@centrum.cz> # Vladimír Vondruš <mosra@centrum.cz>
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
@ -324,7 +317,6 @@ set(_corradeFlags
BUILD_STATIC BUILD_STATIC
BUILD_STATIC_UNIQUE_GLOBALS BUILD_STATIC_UNIQUE_GLOBALS
BUILD_MULTITHREADED BUILD_MULTITHREADED
BUILD_CPU_RUNTIME_DISPATCH
TARGET_UNIX TARGET_UNIX
TARGET_APPLE TARGET_APPLE
TARGET_IOS TARGET_IOS
@ -333,12 +325,10 @@ set(_corradeFlags
TARGET_WINDOWS_RT TARGET_WINDOWS_RT
TARGET_EMSCRIPTEN TARGET_EMSCRIPTEN
TARGET_ANDROID TARGET_ANDROID
# TARGET_X86 etc, TARGET_32BIT, TARGET_BIG_ENDIAN and TARGET_LIBCXX etc. # TARGET_X86 etc and TARGET_LIBCXX are not exposed to CMake as the meaning
# are not exposed to CMake as the meaning is unclear on platforms with # is unclear on platforms with multi-arch binaries or when mixing different
# multi-arch binaries or when mixing different STL implementations. # STL implementations. TARGET_GCC etc are figured out via UseCorrade.cmake,
# TARGET_GCC etc are figured out via UseCorrade.cmake, as the compiler can # as the compiler can be different when compiling the lib & when using it.
# be different when compiling the lib & when using it.
CPU_USE_IFUNC
PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT
TESTSUITE_TARGET_XCTEST TESTSUITE_TARGET_XCTEST
UTILITY_USE_ANSI_COLORS) UTILITY_USE_ANSI_COLORS)
@ -416,8 +406,6 @@ foreach(_component ${Corrade_FIND_COMPONENTS})
if(TARGET Corrade::${_component}) if(TARGET Corrade::${_component})
set(Corrade_${_component}_FOUND TRUE) set(Corrade_${_component}_FOUND TRUE)
else() else()
unset(Corrade_${_component}_FOUND)
# Library (and not header-only) components # Library (and not header-only) components
if(_component IN_LIST _CORRADE_LIBRARY_COMPONENTS AND NOT _component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS) if(_component IN_LIST _CORRADE_LIBRARY_COMPONENTS AND NOT _component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS)
add_library(Corrade::${_component} UNKNOWN IMPORTED) add_library(Corrade::${_component} UNKNOWN IMPORTED)
@ -508,33 +496,25 @@ foreach(_component ${Corrade_FIND_COMPONENTS})
elseif(_component STREQUAL PluginManager) elseif(_component STREQUAL PluginManager)
# -ldl is handled by Utility now # -ldl is handled by Utility now
# TestSuite library has some additional files. If those are not found, # TestSuite library has some additional files
# set the component _FOUND variable to false so it works properly both
# when the component is required and when it's optional.
elseif(_component STREQUAL TestSuite) elseif(_component STREQUAL TestSuite)
# XCTest runner file # XCTest runner file
if(CORRADE_TESTSUITE_TARGET_XCTEST) if(CORRADE_TESTSUITE_TARGET_XCTEST)
find_file(CORRADE_TESTSUITE_XCTEST_RUNNER XCTestRunner.mm.in find_file(CORRADE_TESTSUITE_XCTEST_RUNNER XCTestRunner.mm.in
PATH_SUFFIXES share/corrade/TestSuite) PATH_SUFFIXES share/corrade/TestSuite)
if(NOT CORRADE_TESTSUITE_XCTEST_RUNNER) set(CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED CORRADE_TESTSUITE_XCTEST_RUNNER)
set(Corrade_${_component}_FOUND FALSE)
endif()
# ADB runner file # ADB runner file
elseif(CORRADE_TARGET_ANDROID) elseif(CORRADE_TARGET_ANDROID)
find_file(CORRADE_TESTSUITE_ADB_RUNNER AdbRunner.sh find_file(CORRADE_TESTSUITE_ADB_RUNNER AdbRunner.sh
PATH_SUFFIXES share/corrade/TestSuite) PATH_SUFFIXES share/corrade/TestSuite)
if(NOT CORRADE_TESTSUITE_ADB_RUNNER) set(CORRADE_TESTSUITE_ADB_RUNNER_NEEDED CORRADE_TESTSUITE_ADB_RUNNER)
set(Corrade_${_component}_FOUND FALSE)
endif()
# Emscripten runner file # Emscripten runner file
elseif(CORRADE_TARGET_EMSCRIPTEN) elseif(CORRADE_TARGET_EMSCRIPTEN)
find_file(CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER EmscriptenRunner.html.in find_file(CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER EmscriptenRunner.html.in
PATH_SUFFIXES share/corrade/TestSuite) PATH_SUFFIXES share/corrade/TestSuite)
if(NOT CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER) set(CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER_NEEDED CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER)
set(Corrade_${_component}_FOUND FALSE)
endif()
endif() endif()
# Utility library (contains all setup that is used by others) # Utility library (contains all setup that is used by others)
@ -579,14 +559,11 @@ foreach(_component ${Corrade_FIND_COMPONENTS})
endforeach() endforeach()
endif() endif()
# Decide if the component was found, unless the _FOUND is already set # Decide if the component was found
# by something above. if((_component IN_LIST _CORRADE_LIBRARY_COMPONENTS AND _CORRADE_${_COMPONENT}_INCLUDE_DIR AND (_component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS OR CORRADE_${_COMPONENT}_LIBRARY_RELEASE OR CORRADE_${_COMPONENT}_LIBRARY_DEBUG)) OR (_component IN_LIST _CORRADE_EXECUTABLE_COMPONENTS AND CORRADE_${_COMPONENT}_EXECUTABLE))
if(NOT DEFINED Corrade_${_component}_FOUND) set(Corrade_${_component}_FOUND TRUE)
if((_component IN_LIST _CORRADE_LIBRARY_COMPONENTS AND _CORRADE_${_COMPONENT}_INCLUDE_DIR AND (_component IN_LIST _CORRADE_HEADER_ONLY_COMPONENTS OR CORRADE_${_COMPONENT}_LIBRARY_RELEASE OR CORRADE_${_COMPONENT}_LIBRARY_DEBUG)) OR (_component IN_LIST _CORRADE_EXECUTABLE_COMPONENTS AND CORRADE_${_COMPONENT}_EXECUTABLE)) else()
set(Corrade_${_component}_FOUND TRUE) set(Corrade_${_component}_FOUND FALSE)
else()
set(Corrade_${_component}_FOUND FALSE)
endif()
endif() endif()
endif() endif()
endforeach() endforeach()
@ -613,7 +590,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages. # misleading messages.
elseif(NOT _component IN_LIST _CORRADE_IMPLICITLY_ENABLED_COMPONENTS) elseif(NOT _component IN_LIST _CORRADE_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT) string(TOUPPER ${_component} _COMPONENT)
list(APPEND _CORRADE_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled CORRADE_WITH_${_COMPONENT} when building Corrade.") list(APPEND _CORRADE_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Corrade.")
# Otherwise we have no idea. Better be silent than to print something # Otherwise we have no idea. Better be silent than to print something
# misleading. # misleading.
else() else()
@ -629,6 +606,9 @@ find_package_handle_standard_args(Corrade REQUIRED_VARS
CORRADE_INCLUDE_DIR CORRADE_INCLUDE_DIR
_CORRADE_MODULE_DIR _CORRADE_MODULE_DIR
_CORRADE_CONFIGURE_FILE _CORRADE_CONFIGURE_FILE
${CORRADE_TESTSUITE_XCTEST_RUNNER_NEEDED}
${CORRADE_TESTSUITE_ADB_RUNNER_NEEDED}
${CORRADE_TESTSUITE_EMSCRIPTEN_RUNNER_NEEDED}
HANDLE_COMPONENTS HANDLE_COMPONENTS
${_CORRADE_REASON_FAILURE_MESSAGE}) ${_CORRADE_REASON_FAILURE_MESSAGE})

View File

@ -36,7 +36,7 @@
# This file is part of Magnum. # This file is part of Magnum.
# #
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, # Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022, 2023 Vladimír Vondruš <mosra@centrum.cz> # 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2018 Jonathan Hale <squareys@googlemail.com> # Copyright © 2018 Jonathan Hale <squareys@googlemail.com>
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a

View File

@ -57,7 +57,6 @@
# Audio - Audio library # Audio - Audio library
# DebugTools - DebugTools library # DebugTools - DebugTools library
# GL - GL library # GL - GL library
# MaterialTools - MaterialTools library
# MeshTools - MeshTools library # MeshTools - MeshTools library
# Primitives - Primitives library # Primitives - Primitives library
# SceneGraph - SceneGraph library # SceneGraph - SceneGraph library
@ -79,6 +78,7 @@
# WindowlessGlxApplication - Windowless GLX application # WindowlessGlxApplication - Windowless GLX application
# WindowlessIosApplication - Windowless iOS application # WindowlessIosApplication - Windowless iOS application
# WindowlessWglApplication - Windowless WGL application # WindowlessWglApplication - Windowless WGL application
# WindowlessWindowsEglApplication - Windowless Windows/EGL application
# CglContext - CGL context # CglContext - CGL context
# EglContext - EGL context # EglContext - EGL context
# GlxContext - GLX context # GlxContext - GLX context
@ -128,7 +128,7 @@
# #
# Features of found Magnum library are exposed in these variables: # Features of found Magnum library are exposed in these variables:
# #
# MAGNUM_BUILD_DEPRECATED - Defined if compiled with deprecated features # MAGNUM_BUILD_DEPRECATED - Defined if compiled with deprecated APIs
# included # included
# MAGNUM_BUILD_STATIC - Defined if compiled as static libraries # MAGNUM_BUILD_STATIC - Defined if compiled as static libraries
# MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS - Defined if static libraries keep the # MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS - Defined if static libraries keep the
@ -137,9 +137,10 @@
# MAGNUM_TARGET_GLES - Defined if compiled for OpenGL ES # MAGNUM_TARGET_GLES - Defined if compiled for OpenGL ES
# MAGNUM_TARGET_GLES2 - Defined if compiled for OpenGL ES 2.0 # MAGNUM_TARGET_GLES2 - Defined if compiled for OpenGL ES 2.0
# MAGNUM_TARGET_GLES3 - Defined if compiled for OpenGL ES 3.0 # MAGNUM_TARGET_GLES3 - Defined if compiled for OpenGL ES 3.0
# MAGNUM_TARGET_DESKTOP_GLES - Defined if compiled with OpenGL ES
# emulation on desktop OpenGL
# MAGNUM_TARGET_WEBGL - Defined if compiled for WebGL # MAGNUM_TARGET_WEBGL - Defined if compiled for WebGL
# MAGNUM_TARGET_EGL - Defined if compiled for EGL instead of a # MAGNUM_TARGET_HEADLESS - Defined if compiled for headless machines
# platform-specific OpenGL support library like CGL, EAGL, GLX or WGL
# MAGNUM_TARGET_VK - Defined if compiled with Vulkan interop # MAGNUM_TARGET_VK - Defined if compiled with Vulkan interop
# #
# The following variables are provided for backwards compatibility purposes # The following variables are provided for backwards compatibility purposes
@ -148,10 +149,6 @@
# #
# MAGNUM_BUILD_MULTITHREADED - Alias to CORRADE_BUILD_MULTITHREADED. Use # MAGNUM_BUILD_MULTITHREADED - Alias to CORRADE_BUILD_MULTITHREADED. Use
# CORRADE_BUILD_MULTITHREADED instead. # CORRADE_BUILD_MULTITHREADED instead.
# MAGNUM_TARGET_HEADLESS - Alias to MAGNUM_TARGET_EGL, unless on iOS,
# Android, Emscripten or Windows RT. Use MAGNUM_TARGET_EGL instead.
# MAGNUM_TARGET_DESKTOP_GLES` - Defined if compiled for OpenGL ES but
# GLX / WGL is used instead of EGL. Use MAGNUM_TARGET_EGL instead.
# #
# Additionally these variables are defined for internal usage: # Additionally these variables are defined for internal usage:
# #
@ -205,7 +202,7 @@
# This file is part of Magnum. # This file is part of Magnum.
# #
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, # Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022, 2023 Vladimír Vondruš <mosra@centrum.cz> # 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), # copy of this software and associated documentation files (the "Software"),
@ -228,26 +225,16 @@
# Corrade library dependencies # Corrade library dependencies
set(_MAGNUM_CORRADE_DEPENDENCIES ) set(_MAGNUM_CORRADE_DEPENDENCIES )
foreach(_magnum_component ${Magnum_FIND_COMPONENTS}) foreach(_component ${Magnum_FIND_COMPONENTS})
set(_MAGNUM_${_magnum_component}_CORRADE_DEPENDENCIES ) string(TOUPPER ${_component} _COMPONENT)
# Unrolling the transitive dependencies here so this doesn't need to be # Unrolling the transitive dependencies here so this doesn't need to be
# after resolving inter-component dependencies. Listing also all plugins. # after resolving inter-component dependencies. Listing also all plugins.
if(_magnum_component MATCHES "^(Audio|DebugTools|MeshTools|Primitives|SceneTools|ShaderTools|Text|TextureTools|Trade|.+Importer|.+ImageConverter|.+Font|.+ShaderConverter)$") if(_component MATCHES "^(Audio|DebugTools|MeshTools|Primitives|SceneTools|ShaderTools|Text|TextureTools|Trade|.+Importer|.+ImageConverter|.+Font|.+ShaderConverter)$")
list(APPEND _MAGNUM_${_magnum_component}_CORRADE_DEPENDENCIES PluginManager) set(_MAGNUM_${_COMPONENT}_CORRADE_DEPENDENCIES PluginManager)
endif()
if(_magnum_component STREQUAL DebugTools)
# DebugTools depends on TestSuite optionally, so if it's not there
# assume it wasn't compiled against it. Also, all variables from the
# FindCorrade module overwrite the local variables here (in particular
# _component, _COMPONENT and such), so we need to prefix extensively.
find_package(Corrade QUIET COMPONENTS TestSuite)
if(Corrade_TestSuite_FOUND)
list(APPEND _MAGNUM_${_magnum_component}_CORRADE_DEPENDENCIES TestSuite)
endif()
endif() endif()
list(APPEND _MAGNUM_CORRADE_DEPENDENCIES ${_MAGNUM_${_magnum_component}_CORRADE_DEPENDENCIES}) list(APPEND _MAGNUM_CORRADE_DEPENDENCIES ${_MAGNUM_${_COMPONENT}_CORRADE_DEPENDENCIES})
endforeach() endforeach()
find_package(Corrade REQUIRED Utility ${_MAGNUM_CORRADE_DEPENDENCIES}) find_package(Corrade REQUIRED Utility ${_MAGNUM_CORRADE_DEPENDENCIES})
@ -282,8 +269,9 @@ set(_magnumFlags
TARGET_GLES TARGET_GLES
TARGET_GLES2 TARGET_GLES2
TARGET_GLES3 TARGET_GLES3
TARGET_DESKTOP_GLES
TARGET_WEBGL TARGET_WEBGL
TARGET_EGL TARGET_HEADLESS
TARGET_VK) TARGET_VK)
foreach(_magnumFlag ${_magnumFlags}) foreach(_magnumFlag ${_magnumFlags})
list(FIND _magnumConfigure "#define MAGNUM_${_magnumFlag}" _magnum_${_magnumFlag}) list(FIND _magnumConfigure "#define MAGNUM_${_magnumFlag}" _magnum_${_magnumFlag})
@ -292,20 +280,9 @@ foreach(_magnumFlag ${_magnumFlags})
endif() endif()
endforeach() endforeach()
# For compatibility only, to be removed at some point. Refer to # For compatibility only, to be removed at some point
# src/Magnum/configure.h.cmake for the decision logic here. if(MAGNUM_BUILD_DEPRECATED AND CORRADE_BUILD_MULTITHREADED)
if(MAGNUM_BUILD_DEPRECATED) set(MAGNUM_BUILD_MULTITHREADED 1)
if(CORRADE_BUILD_MULTITHREADED)
set(MAGNUM_BUILD_MULTITHREADED 1)
endif()
if(NOT CORRADE_TARGET_IOS AND NOT CORRADE_TARGET_ANDROID AND NOT CORRADE_TARGET_EMSCRIPTEN AND NOT CORRADE_TARGET_WINDOWS_RT)
if(NOT MAGNUM_TARGET_GLES AND MAGNUM_TARGET_EGL)
set(MAGNUM_TARGET_HEADLESS 1)
endif()
if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_EGL)
set(MAGNUM_TARGET_DESKTOP_GLES 1)
endif()
endif()
endif() endif()
# OpenGL library preference. Prefer to use GLVND, since that's the better # OpenGL library preference. Prefer to use GLVND, since that's the better
@ -378,8 +355,8 @@ endif()
# Component distinction (listing them explicitly to avoid mistakes with finding # Component distinction (listing them explicitly to avoid mistakes with finding
# components from other repositories) # components from other repositories)
set(_MAGNUM_LIBRARY_COMPONENTS set(_MAGNUM_LIBRARY_COMPONENTS
Audio DebugTools GL MaterialTools MeshTools Primitives SceneGraph Audio DebugTools GL MeshTools Primitives SceneGraph SceneTools Shaders
SceneTools Shaders ShaderTools Text TextureTools Trade ShaderTools Text TextureTools Trade
WindowlessEglApplication EglContext OpenGLTester) WindowlessEglApplication EglContext OpenGLTester)
set(_MAGNUM_PLUGIN_COMPONENTS set(_MAGNUM_PLUGIN_COMPONENTS
AnyAudioImporter AnyImageConverter AnyImageImporter AnySceneConverter AnyAudioImporter AnyImageConverter AnyImageImporter AnySceneConverter
@ -418,7 +395,7 @@ if(CORRADE_TARGET_UNIX AND NOT CORRADE_TARGET_APPLE)
list(APPEND _MAGNUM_LIBRARY_COMPONENTS GlxApplication XEglApplication WindowlessGlxApplication GlxContext) list(APPEND _MAGNUM_LIBRARY_COMPONENTS GlxApplication XEglApplication WindowlessGlxApplication GlxContext)
endif() endif()
if(CORRADE_TARGET_WINDOWS) if(CORRADE_TARGET_WINDOWS)
list(APPEND _MAGNUM_LIBRARY_COMPONENTS WindowlessWglApplication WglContext) list(APPEND _MAGNUM_LIBRARY_COMPONENTS WindowlessWglApplication WglContext WindowlessWindowsEglApplication)
endif() endif()
if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_WINDOWS) if(CORRADE_TARGET_UNIX OR CORRADE_TARGET_WINDOWS)
list(APPEND _MAGNUM_EXECUTABLE_COMPONENTS fontconverter distancefieldconverter) list(APPEND _MAGNUM_EXECUTABLE_COMPONENTS fontconverter distancefieldconverter)
@ -443,24 +420,30 @@ if(MAGNUM_TARGET_GL)
set(_MAGNUM_DebugTools_GL_DEPENDENCY_IS_OPTIONAL ON) set(_MAGNUM_DebugTools_GL_DEPENDENCY_IS_OPTIONAL ON)
endif() endif()
set(_MAGNUM_MaterialTools_DEPENDENCIES Trade)
set(_MAGNUM_MeshTools_DEPENDENCIES Trade) set(_MAGNUM_MeshTools_DEPENDENCIES Trade)
if(MAGNUM_TARGET_GL) if(MAGNUM_TARGET_GL)
list(APPEND _MAGNUM_MeshTools_DEPENDENCIES GL) list(APPEND _MAGNUM_MeshTools_DEPENDENCIES GL)
endif() endif()
set(_MAGNUM_OpenGLTester_DEPENDENCIES GL) set(_MAGNUM_OpenGLTester_DEPENDENCIES GL)
if(MAGNUM_TARGET_EGL) if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessEglApplication) list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessEglApplication)
elseif(CORRADE_TARGET_IOS) elseif(CORRADE_TARGET_IOS)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessIosApplication) list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessIosApplication)
elseif(CORRADE_TARGET_APPLE) elseif(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessCglApplication) list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessCglApplication)
elseif(CORRADE_TARGET_UNIX) elseif(CORRADE_TARGET_UNIX)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessGlxApplication) if(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessEglApplication)
else()
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessGlxApplication)
endif()
elseif(CORRADE_TARGET_WINDOWS) elseif(CORRADE_TARGET_WINDOWS)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessWglApplication) if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessWglApplication)
else()
list(APPEND _MAGNUM_OpenGLTester_DEPENDENCIES WindowlessWindowsEglApplication)
endif()
endif() endif()
set(_MAGNUM_Primitives_DEPENDENCIES MeshTools Trade) set(_MAGNUM_Primitives_DEPENDENCIES MeshTools Trade)
@ -509,6 +492,7 @@ set(_MAGNUM_WindowlessEglApplication_DEPENDENCIES GL)
set(_MAGNUM_WindowlessGlxApplication_DEPENDENCIES GL) set(_MAGNUM_WindowlessGlxApplication_DEPENDENCIES GL)
set(_MAGNUM_WindowlessIosApplication_DEPENDENCIES GL) set(_MAGNUM_WindowlessIosApplication_DEPENDENCIES GL)
set(_MAGNUM_WindowlessWglApplication_DEPENDENCIES GL) set(_MAGNUM_WindowlessWglApplication_DEPENDENCIES GL)
set(_MAGNUM_WindowlessWindowsEglApplication_DEPENDENCIES GL)
set(_MAGNUM_XEglApplication_DEPENDENCIES GL) set(_MAGNUM_XEglApplication_DEPENDENCIES GL)
set(_MAGNUM_CglContext_DEPENDENCIES GL) set(_MAGNUM_CglContext_DEPENDENCIES GL)
set(_MAGNUM_EglContext_DEPENDENCIES GL) set(_MAGNUM_EglContext_DEPENDENCIES GL)
@ -724,16 +708,16 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# OPENGL_opengl_LIBRARY because that's set even if # OPENGL_opengl_LIBRARY because that's set even if
# OpenGL_GL_PREFERENCE is explicitly set to LEGACY. # OpenGL_GL_PREFERENCE is explicitly set to LEGACY.
if(MAGNUM_TARGET_GL) if(MAGNUM_TARGET_GL)
if(MAGNUM_TARGET_EGL) if(CORRADE_TARGET_UNIX AND NOT CORRADE_TARGET_APPLE AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES))
find_package(EGL)
set_property(TARGET Magnum::${_component} APPEND
PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL)
elseif(CORRADE_TARGET_UNIX AND NOT CORRADE_TARGET_APPLE)
find_package(OpenGL) find_package(OpenGL)
if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND) if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND)
set_property(TARGET Magnum::${_component} APPEND set_property(TARGET Magnum::${_component} APPEND
PROPERTY INTERFACE_LINK_LIBRARIES OpenGL::GLX) PROPERTY INTERFACE_LINK_LIBRARIES OpenGL::GLX)
endif() endif()
elseif(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES AND NOT CORRADE_TARGET_EMSCRIPTEN)
find_package(EGL)
set_property(TARGET Magnum::${_component} APPEND
PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL)
endif() endif()
endif() endif()
@ -763,16 +747,16 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# OPENGL_opengl_LIBRARY because that's set even if # OPENGL_opengl_LIBRARY because that's set even if
# OpenGL_GL_PREFERENCE is explicitly set to LEGACY. # OpenGL_GL_PREFERENCE is explicitly set to LEGACY.
if(MAGNUM_TARGET_GL) if(MAGNUM_TARGET_GL)
if(MAGNUM_TARGET_EGL) if(CORRADE_TARGET_UNIX AND NOT CORRADE_TARGET_APPLE AND (NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES))
find_package(EGL)
set_property(TARGET Magnum::${_component} APPEND
PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL)
elseif(CORRADE_TARGET_UNIX AND NOT CORRADE_TARGET_APPLE)
find_package(OpenGL) find_package(OpenGL)
if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND) if(OPENGL_opengl_LIBRARY AND OpenGL_GL_PREFERENCE STREQUAL GLVND)
set_property(TARGET Magnum::${_component} APPEND set_property(TARGET Magnum::${_component} APPEND
PROPERTY INTERFACE_LINK_LIBRARIES OpenGL::GLX) PROPERTY INTERFACE_LINK_LIBRARIES OpenGL::GLX)
endif() endif()
elseif(MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_DESKTOP_GLES AND NOT CORRADE_TARGET_EMSCRIPTEN)
find_package(EGL)
set_property(TARGET Magnum::${_component} APPEND
PROPERTY INTERFACE_LINK_LIBRARIES EGL::EGL)
endif() endif()
endif() endif()
@ -815,6 +799,12 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# Windowless WGL application has no additional dependencies # Windowless WGL application has no additional dependencies
# Windowless Windows/EGL application dependencies
elseif(_component STREQUAL WindowlessWindowsEglApplication)
find_package(EGL)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES EGL::EGL)
# X/EGL application dependencies # X/EGL application dependencies
elseif(_component STREQUAL XEglApplication) elseif(_component STREQUAL XEglApplication)
find_package(EGL) find_package(EGL)
@ -864,13 +854,13 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
elseif(_component STREQUAL Audio) elseif(_component STREQUAL Audio)
find_package(OpenAL) find_package(OpenAL)
set_property(TARGET Magnum::${_component} APPEND PROPERTY set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES OpenAL::OpenAL) INTERFACE_LINK_LIBRARIES Corrade::PluginManager OpenAL::OpenAL)
# No special setup for DebugTools library # No special setup for DebugTools library
# GL library # GL library
elseif(_component STREQUAL GL) elseif(_component STREQUAL GL)
if(NOT MAGNUM_TARGET_GLES OR (MAGNUM_TARGET_GLES AND NOT MAGNUM_TARGET_EGL AND NOT CORRADE_TARGET_IOS)) if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
# If the GLVND library (CMake 3.11+) was found, link to the # If the GLVND library (CMake 3.11+) was found, link to the
# imported target. Otherwise (and also on all systems except # imported target. Otherwise (and also on all systems except
# Linux) link to the classic libGL. Can't use # Linux) link to the classic libGL. Can't use
@ -896,10 +886,6 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
INTERFACE_LINK_LIBRARIES OpenGLES3::OpenGLES3) INTERFACE_LINK_LIBRARIES OpenGLES3::OpenGLES3)
endif() endif()
# MaterialTools library
elseif(_component STREQUAL MaterialTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES PhongToPbrMetallicRoughness.h)
# MeshTools library # MeshTools library
elseif(_component STREQUAL MeshTools) elseif(_component STREQUAL MeshTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES CompressIndices.h)
@ -918,19 +904,26 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# No special setup for SceneGraph library # No special setup for SceneGraph library
# SceneTools library # ShaderTools library
elseif(_component STREQUAL SceneTools) elseif(_component STREQUAL ShaderTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Hierarchy.h) set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::PluginManager)
# No special setup for ShaderTools library
# No special setup for Shaders library # No special setup for Shaders library
# No special setup for Text library
# Text library
elseif(_component STREQUAL Text)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::PluginManager)
# TextureTools library # TextureTools library
elseif(_component STREQUAL TextureTools) elseif(_component STREQUAL TextureTools)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h) set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h)
# No special setup for Trade library # Trade library
elseif(_component STREQUAL Trade)
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::PluginManager)
# Vk library # Vk library
elseif(_component STREQUAL Vk) elseif(_component STREQUAL Vk)
@ -959,13 +952,8 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
endif() endif()
# Automatic import of static plugins. Skip in case the include dir was # Automatic import of static plugins. Skip in case the include dir was
# not found -- that'll fail later with a proper message. Skip it also # not found -- that'll fail later with a proper message.
# if the include dir doesn't contain the generated configure.h, which if(_component IN_LIST _MAGNUM_PLUGIN_COMPONENTS AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
# is the case with Magnum as a subproject and given plugin not enabled
# -- there it finds just the sources, where's just configure.h.cmake,
# and that's not useful for anything. The assumption here is that it
# will fail later anyway on the binary not being found.
if(_component IN_LIST _MAGNUM_PLUGIN_COMPONENTS AND _MAGNUM_${_COMPONENT}_INCLUDE_DIR AND EXISTS ${_MAGNUM_${_COMPONENT}_INCLUDE_DIR}/configure.h)
# Automatic import of static plugins # Automatic import of static plugins
file(READ ${_MAGNUM_${_COMPONENT}_INCLUDE_DIR}/configure.h _magnum${_component}Configure) file(READ ${_MAGNUM_${_COMPONENT}_INCLUDE_DIR}/configure.h _magnum${_component}Configure)
string(FIND "${_magnum${_component}Configure}" "#define MAGNUM_${_COMPONENT}_BUILD_STATIC" _magnum${_component}_BUILD_STATIC) string(FIND "${_magnum${_component}Configure}" "#define MAGNUM_${_COMPONENT}_BUILD_STATIC" _magnum${_component}_BUILD_STATIC)
@ -979,10 +967,6 @@ foreach(_component ${Magnum_FIND_COMPONENTS})
# are optional dependencies, defer adding them to later once we know if # are optional dependencies, defer adding them to later once we know if
# they were found or not. # they were found or not.
if(_component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS) if(_component IN_LIST _MAGNUM_LIBRARY_COMPONENTS OR _component IN_LIST _MAGNUM_PLUGIN_COMPONENTS)
foreach(_dependency ${_MAGNUM_${_component}_CORRADE_DEPENDENCIES})
set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Corrade::${_dependency})
endforeach()
set_property(TARGET Magnum::${_component} APPEND PROPERTY set_property(TARGET Magnum::${_component} APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Magnum::Magnum) INTERFACE_LINK_LIBRARIES Magnum::Magnum)
set(_MAGNUM_${component}_OPTIONAL_DEPENDENCIES_TO_ADD ) set(_MAGNUM_${component}_OPTIONAL_DEPENDENCIES_TO_ADD )
@ -1058,10 +1042,6 @@ if(CORRADE_TARGET_EMSCRIPTEN)
# IN_LIST as an operator since 3.1 (Emscripten needs at least 3.7), but # IN_LIST as an operator since 3.1 (Emscripten needs at least 3.7), but
# it's behind a policy, so enable that one as well. # it's behind a policy, so enable that one as well.
cmake_policy(SET CMP0057 NEW) cmake_policy(SET CMP0057 NEW)
# TODO since 1.39.19 it's possible to use `-sUSE_WEBGL2=1`, which can be
# then passed via target_link_libraries() etc. without requiring CMake
# 3.13: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#13919-07072020
# -- change to that once we drop support for older Emscripten versions
if(CMAKE_VERSION VERSION_LESS 3.13 AND GL IN_LIST Magnum_FIND_COMPONENTS AND NOT MAGNUM_TARGET_GLES2 AND NOT CMAKE_EXE_LINKER_FLAGS MATCHES "-s USE_WEBGL2=1") if(CMAKE_VERSION VERSION_LESS 3.13 AND GL IN_LIST Magnum_FIND_COMPONENTS AND NOT MAGNUM_TARGET_GLES2 AND NOT CMAKE_EXE_LINKER_FLAGS MATCHES "-s USE_WEBGL2=1")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1")
endif() endif()
@ -1089,7 +1069,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages. # misleading messages.
elseif(NOT _component IN_LIST _MAGNUM_IMPLICITLY_ENABLED_COMPONENTS) elseif(NOT _component IN_LIST _MAGNUM_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT) string(TOUPPER ${_component} _COMPONENT)
list(APPEND _MAGNUM_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled MAGNUM_WITH_${_COMPONENT} when building Magnum.") list(APPEND _MAGNUM_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum.")
# Otherwise we have no idea. Better be silent than to print something # Otherwise we have no idea. Better be silent than to print something
# misleading. # misleading.
else() else()

View File

@ -48,7 +48,7 @@
# This file is part of Magnum. # This file is part of Magnum.
# #
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, # Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022, 2023 Vladimír Vondruš <mosra@centrum.cz> # 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2018 Konstantinos Chatzilygeroudis <costashatz@gmail.com> # Copyright © 2018 Konstantinos Chatzilygeroudis <costashatz@gmail.com>
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
@ -314,7 +314,7 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.16)
# misleading messages. # misleading messages.
elseif(NOT _component IN_LIST _MAGNUMINTEGRATION_IMPLICITLY_ENABLED_COMPONENTS) elseif(NOT _component IN_LIST _MAGNUMINTEGRATION_IMPLICITLY_ENABLED_COMPONENTS)
string(TOUPPER ${_component} _COMPONENT) string(TOUPPER ${_component} _COMPONENT)
list(APPEND _MAGNUMINTEGRATION_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled MAGNUM_WITH_${_COMPONENT} when building Magnum Integration.") list(APPEND _MAGNUMINTEGRATION_REASON_FAILURE_MESSAGE "${_component} is not built by default. Make sure you enabled WITH_${_COMPONENT} when building Magnum Integration.")
# Otherwise we have no idea. Better be silent than to print something # Otherwise we have no idea. Better be silent than to print something
# misleading. # misleading.
else() else()

View File

@ -20,7 +20,7 @@
# This file is part of Magnum. # This file is part of Magnum.
# #
# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, # Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
# 2020, 2021, 2022, 2023 Vladimír Vondruš <mosra@centrum.cz> # 2020, 2021, 2022 Vladimír Vondruš <mosra@centrum.cz>
# Copyright © 2018 Jonathan Hale <squareys@googlemail.com> # Copyright © 2018 Jonathan Hale <squareys@googlemail.com>
# #
# Permission is hereby granted, free of charge, to any person obtaining a # Permission is hereby granted, free of charge, to any person obtaining a
@ -138,10 +138,10 @@ else()
# which CMake somehow prefers before the SDL2-2.0.dylib file. Making # which CMake somehow prefers before the SDL2-2.0.dylib file. Making
# the dylib first so it is preferred. Not sure how this maps to debug # the dylib first so it is preferred. Not sure how this maps to debug
# config though :/ # config though :/
NAMES SDL2-2.0 SDL2 SDL2-static NAMES SDL2-2.0 SDL2
PATH_SUFFIXES ${_SDL2_LIBRARY_PATH_SUFFIX}) PATH_SUFFIXES ${_SDL2_LIBRARY_PATH_SUFFIX})
find_library(SDL2_LIBRARY_DEBUG find_library(SDL2_LIBRARY_DEBUG
NAMES SDL2d SDL2-staticd NAMES SDL2d
PATH_SUFFIXES ${_SDL2_LIBRARY_PATH_SUFFIX}) PATH_SUFFIXES ${_SDL2_LIBRARY_PATH_SUFFIX})
# FPHSA needs one of the _DEBUG/_RELEASE variables to check that the # FPHSA needs one of the _DEBUG/_RELEASE variables to check that the
# library was found -- using SDL_LIBRARY, which will get populated by # library was found -- using SDL_LIBRARY, which will get populated by

View File

@ -156,14 +156,6 @@ Configuration::setSkipDisclaimer(bool mode) {
_conf.save(); _conf.save();
} }
bool Configuration::isRunningInWine() const {
return _isRunningInWine;
}
void Configuration::setRunningInWine(bool wine) {
_isRunningInWine = wine;
}
Configuration& Configuration&
Configuration::instance() { Configuration::instance() {
static Configuration conf{}; static Configuration conf{};

View File

@ -46,9 +46,6 @@ class Configuration {
bool skipDisclaimer() const; bool skipDisclaimer() const;
void setSkipDisclaimer(bool mode); void setSkipDisclaimer(bool mode);
bool isRunningInWine() const;
void setRunningInWine(bool wine);
private: private:
explicit Configuration(); explicit Configuration();
@ -60,8 +57,6 @@ class Configuration {
bool _advancedMode = false; bool _advancedMode = false;
bool _checkUpdatesOnStartup = true; bool _checkUpdatesOnStartup = true;
bool _skipDisclaimer = false; bool _skipDisclaimer = false;
bool _isRunningInWine = false;
}; };
Configuration& conf(); Configuration& conf();

View File

@ -337,12 +337,6 @@ SaveTool::drawDisclaimer() {
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextUnformatted("This version of the application was tested on M.A.S.S. Builder early access version " SUPPORTED_GAME_VERSION ". It may or may not work with other versions of the game."); ImGui::TextUnformatted("This version of the application was tested on M.A.S.S. Builder early access version " SUPPORTED_GAME_VERSION ". It may or may not work with other versions of the game.");
if(conf().isRunningInWine()) {
ImGui::Bullet();
ImGui::SameLine();
ImGui::TextUnformatted("You are currently running this application in Wine/Proton. It hasn't been fully tested, so some issues may arise. Furthermore, features may be unavailable.");
}
ImGui::PopTextWrapPos(); ImGui::PopTextWrapPos();
if(ImGui::BeginTable("##DisclaimerLayoutTable", 3)) { if(ImGui::BeginTable("##DisclaimerLayoutTable", 3)) {
@ -436,12 +430,9 @@ SaveTool::drawCheckbox(Containers::StringView label, bool value) {
void void
SaveTool::openUri(Containers::StringView uri) { SaveTool::openUri(Containers::StringView uri) {
if(!conf().isRunningInWine()) { ShellExecuteW(nullptr, nullptr, Utility::Unicode::widen(uri.data()), nullptr, nullptr, SW_SHOWDEFAULT);
ShellExecuteA(nullptr, nullptr, uri.data(), nullptr, nullptr, SW_SHOWDEFAULT); // TODO: have it open folders through winebrowser.exe when running using Wine/Proton.
} // URLs like Discord invites or Steam Browser Protocol links should be disabled entirely there.
else {
std::system(Utility::format("winebrowser.exe {}", uri).cbegin());
}
} }
void void

View File

@ -159,7 +159,6 @@ SaveTool::drawMainMenu() {
ImGui::EndMenu(); ImGui::EndMenu();
} }
ImGui::BeginDisabled(conf().isRunningInWine());
if(ImGui::BeginMenu("Game##GameMenu")) { if(ImGui::BeginMenu("Game##GameMenu")) {
if(ImGui::MenuItem(ICON_FA_PLAY " Run demo##RunDemoMenuItem")) { if(ImGui::MenuItem(ICON_FA_PLAY " Run demo##RunDemoMenuItem")) {
openUri("steam://run/1048390"); openUri("steam://run/1048390");
@ -186,10 +185,6 @@ SaveTool::drawMainMenu() {
ImGui::EndMenu(); ImGui::EndMenu();
} }
ImGui::EndDisabled();
if(conf().isRunningInWine() && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
ImGui::SetTooltip("Not available when running in Wine.");
}
#ifdef SAVETOOL_DEBUG_BUILD #ifdef SAVETOOL_DEBUG_BUILD
if(ImGui::BeginMenu("Debug tools")) { if(ImGui::BeginMenu("Debug tools")) {

View File

@ -22,7 +22,6 @@
#include <synchapi.h> #include <synchapi.h>
#include <winerror.h> #include <winerror.h>
#include "Configuration/Configuration.h"
#include "Logger/MagnumLogBuffer.h" #include "Logger/MagnumLogBuffer.h"
#include "SaveTool/SaveTool.h" #include "SaveTool/SaveTool.h"
@ -51,11 +50,6 @@ int main(int argc, char** argv) {
"Your system doesn't support UTF-8.", nullptr); "Your system doesn't support UTF-8.", nullptr);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if(locale.hasSuffix(".65001")) {
LOG_INFO("Wine detected.");
conf().setRunningInWine(true);
}
} }
auto mutex_handle = CreateMutexW(nullptr, 0, L"MassBuilderSaveTool"); auto mutex_handle = CreateMutexW(nullptr, 0, L"MassBuilderSaveTool");