Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ if(NOT ANDROID)
endif()

option(USE_SHARED_ENET "Use shared libenet if found rather than Dolphin's soon-to-compatibly-diverge version" OFF)
option(USE_SHARED_LIBPNG "Use shared libpng if found" ON)
option(USE_UPNP "Enables UPnP port mapping support" ON)
option(ENABLE_NOGUI "Enable NoGUI frontend" ON)
option(ENABLE_QT "Enable Qt (Default)" ON)
Expand All @@ -71,6 +72,7 @@ option(ENABLE_VULKAN "Enables vulkan video backend" ON)
option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current game on Discord" ON)
option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON)
option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON)
option(STEAM "Creates a build for Steam" ON)

# Maintainers: if you consider blanket disabling this for your users, please
# consider the following points:
Expand Down Expand Up @@ -412,6 +414,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
find_library(IOB_LIBRARY IOBluetooth)
find_library(IOK_LIBRARY IOKit)
find_library(OPENGL_LIBRARY OpenGL)

# We don't want to use shared libpng.
set(USE_SHARED_LIBPNG OFF)
endif()

if(ENABLE_LTO)
Expand All @@ -427,8 +432,10 @@ if(ENABLE_LTO)
endif()
endif()

if(UNIX AND LINUX_LOCAL_DEV)
add_definitions(-DLINUX_LOCAL_DEV)
if(UNIX)
if(LINUX_LOCAL_DEV OR (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM))
add_definitions(-DLINUX_LOCAL_DEV)
endif()
endif()

# BSDs put packages in /usr/local instead of /usr, so we need to
Expand Down Expand Up @@ -783,7 +790,7 @@ else()
set(LZO lzo2)
endif()

if(NOT APPLE)
if(USE_SHARED_LIBPNG)
check_lib(PNG libpng png png.h QUIET)
endif()
if (PNG_FOUND)
Expand Down Expand Up @@ -937,6 +944,10 @@ else()
message(STATUS "libsystemd not found, disabling traversal server watchdog support")
endif()

if(STEAM)
add_definitions(-DSTEAM)
endif()

if (WIN32)
include_directories(Externals/WIL/include)
include_directories(Externals/OpenAL/include)
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/Common/GL/GLInterface/GLX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@

typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSPROC)(Display*, GLXFBConfig, GLXContext, Bool,
const int*);

#ifndef GLX_EXT_swap_control
typedef void (*PFNGLXSWAPINTERVALEXTPROC)(Display*, GLXDrawable, int);
#endif

typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int);

static PFNGLXCREATECONTEXTATTRIBSPROC glXCreateContextAttribs = nullptr;
Expand Down
10 changes: 7 additions & 3 deletions Source/Core/Core/IOS/FS/HostBackend/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,16 +552,20 @@ ResultCode HostFileSystem::Rename(Uid uid, Gid gid, const std::string& old_path,
}
}

// Finally, remove the child from the old parent and move it to the new parent.
FstEntry* new_entry = GetFstEntryForPath(new_path);
new_entry->name = split_new_path.file_name;

// Finally, remove the child from the old parent and move it to the new parent.
const auto it = std::find_if(old_parent->children.begin(), old_parent->children.end(),
GetNamePredicate(split_old_path.file_name));
if (it != old_parent->children.end())
{
*new_entry = *it;
new_entry->data = it->data;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it doesn't matter but this is different behavior than before because all of the FstEntry isn't copied. It'd be nice to keep the copy constructor behavior. What was the ut failure?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data, children, and name (which we don't care about because it's the old name) are all the members of this struct.

Any test that attempted using Rename would crash when running it within the steamrt. I posted a valgrind output in a comment above.

new_entry->children = it->children;

old_parent->children.erase(it);
}
new_entry->name = split_new_path.file_name;

SaveFst();

return ResultCode::Success;
Expand Down
41 changes: 41 additions & 0 deletions Source/Core/DolphinQt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,47 @@ else()
install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir})
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM)
# Set that we want ORIGIN in FLAGS.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could possibly use BUILD_RPATH_USE_ORIGIN though that wouldn't allow you to disable the tags...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I tried that earlier and it used RUNPATH?

# We also want RPATH, not RUNPATH, so disable the new tags.
target_link_options(dolphin-emu
PRIVATE
LINKER:-z,origin
LINKER:--disable-new-dtags
)

# For Steam Runtime builds, our Qt shared libraries will be in a "lib" folder.
set_target_properties(dolphin-emu PROPERTIES
BUILD_WITH_INSTALL_RPATH true
INSTALL_RPATH "\$ORIGIN/lib"
)

add_custom_command(TARGET dolphin-emu POST_BUILD
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this isn't done all the time? Is Qt managed by the system or do we have a special build like on Windows?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no Qt present in the steamrt, so yes, we provide our own build. It's not in a submodule, though. I believe we will just have it on the builder.

COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND cp -P "${QT_DIR}/../../*.so*" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib"
COMMAND ${CMAKE_COMMAND} -E copy_directory "${QT_DIR}/../../../plugins/platforms" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/platforms"
Comment thread
delroth marked this conversation as resolved.
)
Comment thread
OatmealDome marked this conversation as resolved.

# Copy qt.conf
target_sources(dolphin-emu PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf")
add_custom_command(TARGET dolphin-emu POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/qt.conf" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/qt.conf"
)

# Mark all data files as resources
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/Data/Sys")
file(GLOB_RECURSE resources RELATIVE "${CMAKE_SOURCE_DIR}/Data" "${CMAKE_SOURCE_DIR}/Data/Sys/*")
foreach(res ${resources})
target_sources(dolphin-emu PRIVATE "${CMAKE_SOURCE_DIR}/Data/${res}")
source_group("Resources" FILES "${CMAKE_SOURCE_DIR}/Data/${res}")
endforeach()

# Copy Sys folder
add_custom_command(TARGET dolphin-emu POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/Data/Sys" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Sys"
)
endif()

if(USE_MGBA)
target_sources(dolphin-emu PRIVATE
GBAHost.cpp
Expand Down