diff --git a/CMakeLists.txt b/CMakeLists.txt index 5525958..ab1e3a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,10 @@ if (APPLE) enable_language(OBJC OBJCXX) endif() +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + option(RECOMP_FLATPAK "Configure the build for Flatpak compatibility." OFF) +endif() + # Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24: if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") cmake_policy(SET CMP0135 NEW) @@ -41,6 +45,10 @@ set(RT64_STATIC TRUE) set(RT64_SDL_WINDOW_VULKAN TRUE) add_compile_definitions(HLSL_CPU) +if (RECOMP_FLATPAK) + add_compile_definitions(RECOMP_FLATPAK) +endif() + add_subdirectory(${CMAKE_SOURCE_DIR}/lib/rt64 ${CMAKE_BINARY_DIR}/rt64) # set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}") diff --git a/src/main/main.cpp b/src/main/main.cpp index ad5331a..a2d809f 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -602,14 +602,12 @@ int main(int argc, char** argv) { SDL_setenv("SDL_AUDIODRIVER", "wasapi", true); #endif -#if 0 #if defined(__linux__) && defined(RECOMP_FLATPAK) // When using Flatpak, applications tend to launch from the home directory by default. // Mods might use the current working directory to store the data, so we switch it to a directory // with persistent data storage and write permissions under Flatpak to ensure it works. std::error_code ec; std::filesystem::current_path("/var/data", ec); -#endif #endif // Initialize SDL audio and set the output frequency.