CMake: Remove Flatpak specific commands

Also no longer needed.
pull/3566/head
Stenzek 1 month ago
parent 84c6be74d3
commit 6126209a25
No known key found for this signature in database

@ -105,12 +105,6 @@ endif()
# Write binaries to a seperate directory.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
# Installation directories. Everything goes into one directory.
if(ALLOW_INSTALL)
set(CMAKE_INSTALL_BINDIR "${CMAKE_INSTALL_PREFIX}")
set(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}")
endif()
# Enable large file support on Linux 32-bit platforms.
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_definitions("-D_FILE_OFFSET_BITS=64")

@ -42,8 +42,6 @@ function(copy_base_translations target)
target_sources(${target} PRIVATE ${path})
if(APPLE)
set_source_files_properties(${path} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/translations)
elseif(ALLOW_INSTALL)
install(FILES "${path}" DESTINATION "${CMAKE_INSTALL_BINDIR}/translations")
else()
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${path}" "$<TARGET_FILE_DIR:${target}>/translations")

@ -10,7 +10,6 @@ option(DISABLE_SSE4 "Build with SSE4 instructions disabled, reduces performance"
if(LINUX OR BSD)
option(ENABLE_X11 "Support X11 window system" ON)
option(ENABLE_WAYLAND "Support Wayland window system" ON)
option(ALLOW_INSTALL "Allow installation to CMAKE_INSTALL_PREFIX" OFF)
endif()
if(APPLE)
option(SKIP_POSTPROCESS_BUNDLE "Disable bundle post-processing, including Qt additions" OFF)

@ -26,15 +26,6 @@ if(BUILD_TESTS)
message(STATUS "Building unit tests.")
endif()
if(ALLOW_INSTALL)
message(STATUS "Creating self-contained install at ${CMAKE_INSTALL_PREFIX}")
# Stop users being silly.
if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr")
message(FATAL_ERROR "You are trying to install DuckStation into a system directory, this is not supported. Please use a different CMAKE_INSTALL_PREFIX.")
endif()
endif()
# Refuse to build in Arch package environments. My license does not allow for packages, and I'm sick of
# dealing with people complaining about things broken by packagers. This is why we can't have nice things.
if(DEFINED ENV{DEBUGINFOD_URLS})

@ -13,9 +13,9 @@ find_package(SDL3 3.2.22 REQUIRED)
find_package(zstd 1.5.7 REQUIRED)
find_package(WebP REQUIRED) # v1.4.0, spews an error on Linux because no pkg-config.
find_package(ZLIB REQUIRED) # 1.3, but Mac currently doesn't use it.
find_package(PNG 1.6.44 REQUIRED) # 1.6.48, but Flatpak is out of date.
find_package(PNG 1.6.50 REQUIRED)
find_package(JPEG REQUIRED)
find_package(Freetype 2.13.2 REQUIRED) # 2.13.3, but flatpak is still on 2.13.2.
find_package(Freetype 2.13.3 REQUIRED) # 2.13.3, but flatpak is still on 2.13.2.
find_package(plutosvg 0.0.6 REQUIRED)
find_package(cpuinfo REQUIRED)
find_package(DiscordRPC 3.4.0 REQUIRED)
@ -40,14 +40,13 @@ if(ENABLE_WAYLAND)
endif()
if(BUILD_QT_FRONTEND)
# 6.9.1, but flatpak stuck on 6.9.0 because they love to ship vulnerable software.
find_package(Qt6 6.9.0 COMPONENTS Core Gui Widgets LinguistTools REQUIRED)
find_package(Qt6 6.9.2 COMPONENTS Core Gui Widgets LinguistTools REQUIRED)
endif()
find_package(Shaderc REQUIRED)
find_package(spirv_cross_c_shared REQUIRED)
if(LINUX AND NOT ALLOW_INSTALL)
if(LINUX)
# We need to add the rpath for shaderc to the executable.
get_target_property(SHADERC_LIBRARY Shaderc::shaderc_shared IMPORTED_LOCATION)
get_filename_component(SHADERC_LIBRARY_DIRECTORY ${SHADERC_LIBRARY} DIRECTORY)

@ -246,22 +246,6 @@ function(get_scm_version)
endif()
endfunction()
function(install_imported_dep_library name)
get_target_property(SONAME "${name}" IMPORTED_SONAME_RELEASE)
get_target_property(LOCATION "${name}" IMPORTED_LOCATION_RELEASE)
# Only install if it's not a system library.
foreach(path ${CMAKE_PREFIX_PATH})
if (NOT "${LOCATION}" MATCHES "^${path}")
message(STATUS "Not installing imported system library ${name}")
return()
endif()
endforeach()
message(STATUS "Installing imported library ${SONAME}")
install(FILES "${LOCATION}" RENAME "${SONAME}" DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endfunction()
function(add_debug_symbol_flag var)
# CMake's regex engine is missing so many features...
set(value "${${var}}")

@ -221,12 +221,6 @@ function(add_core_resources target)
endif()
add_resources(${target} ${path} ${CMAKE_SOURCE_DIR}/data/resources/)
endforeach()
if(ALLOW_INSTALL)
install_imported_dep_library(cpuinfo::cpuinfo)
install_imported_dep_library(DiscordRPC::discord-rpc)
install_imported_dep_library(libzip::zip)
install(DIRECTORY "$<TARGET_FILE_DIR:${target}>/resources" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
# Linux platforms need a copy of the .desktop and icon file because Wayland stupidity.
# See QtHost::EarlyProcessStartup() for where this is used and why. We still need to set it when running

@ -271,11 +271,6 @@ elseif(APPLE)
set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/DuckStation.icns" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif()
if(ALLOW_INSTALL)
# Install main binary.
install(TARGETS duckstation-qt RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif()
# Compile qrc to a binary file.
if(NOT APPLE)
set(RCC_FILE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/resources/duckstation-qt.rcc")
@ -298,9 +293,6 @@ if(NOT APPLE)
foreach (QM_FILE IN LISTS QM_FILES)
get_filename_component(QM_FILE_NAME ${QM_FILE} NAME)
add_custom_command(TARGET duckstation-qt POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${QM_FILE}" "${QM_OUTPUT_DIR}/${QM_FILE_NAME}")
if(ALLOW_INSTALL)
install(FILES "${QM_FILE}" DESTINATION "${CMAKE_INSTALL_BINDIR}/translations")
endif()
endforeach()
else()
foreach (QM_FILE IN LISTS QM_FILES)

@ -324,15 +324,5 @@ function(add_util_resources target)
target_sources(${target} PRIVATE ${version_lib})
set_source_files_properties(${target} PRIVATE ${version_lib} PROPERTIES MACOSX_PACKAGE_LOCATION Frameworks)
endforeach()
elseif(ALLOW_INSTALL)
# Ensure we look for dependency libraries in the installation directory.
set_target_properties(${target} PROPERTIES INSTALL_RPATH "$ORIGIN")
# Copy dependency libraries to installation directory.
install_imported_dep_library(SDL3::SDL3)
install_imported_dep_library(Shaderc::shaderc_shared)
install_imported_dep_library(spirv-cross-c-shared)
install_imported_dep_library(SoundTouch::SoundTouchDLL)
install_imported_dep_library(plutosvg::plutosvg)
endif()
endfunction()

Loading…
Cancel
Save