New option ENABLE_NETWORKING, which defaults to ON.

If OFF, this disables rp-download and all associated downloading code
in the GTK and KDE UI frontends (e.g. Update Checker and ProxyForUrl),
and disables ExecRpDownload in libcachemanager.

NOTE: The KF5 and KF6 ThumbnailCreator plugins definitely needed the
NetworkManaer D-Bus interface for isMetered(), but it wasn't linked
in before. This didn't seem to cause a problem, but with the adjustments
for ENABLE_NETWORKING, it's now causing a linker error. Add the
generated D-Bus interface source to the ThumbnailCreator plugins
to fix this.

TODO:
- Don't generate or use the NetworkManager D-Bus interface in
  no-network builds.
- Windows UI frontend changes.
- Disable the relevant configuration boxes in rp-config (but don't
  remove them entirely).
- Remove functions from the seccomp() whitelists that are no longer
  needed because we're not executing rp-download.
This commit is contained in:
David Korth 2025-01-19 01:23:02 -05:00
parent 1cb75c3884
commit 4a82bf28ab
14 changed files with 143 additions and 51 deletions

View File

@ -155,8 +155,11 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
OPTION(ENABLE_NIXOS "Enable special handling for NixOS builds." OFF)
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Achievements. (TODO: "AUTO" option?)
# Achievements (TODO: "AUTO" option?)
OPTION(ENABLE_ACHIEVEMENTS "Enable achievement pop-ups." ON)
# Network support for e.g. downloads of external artwork and update checking
OPTION(ENABLE_NETWORKING "Enable network support for e.g. downloads of external artwork and update checking" ON)
# Install documentation
OPTION(INSTALL_DOC "Install documentation." ON)

View File

@ -135,7 +135,6 @@ ADD_SUBDIRECTORY(librpsecure)
ADD_SUBDIRECTORY(libi18n)
ADD_SUBDIRECTORY(librpthreads)
ADD_SUBDIRECTORY(libcachecommon)
ADD_SUBDIRECTORY(rp-download)
ADD_SUBDIRECTORY(librpcpuid)
ADD_SUBDIRECTORY(librpbyteswap)
ADD_SUBDIRECTORY(librpfile)
@ -148,6 +147,9 @@ ADD_SUBDIRECTORY(libromdata)
IF(BUILD_CLI)
ADD_SUBDIRECTORY(rpcli)
ENDIF(BUILD_CLI)
IF(ENABLE_NETWORKING)
ADD_SUBDIRECTORY(rp-download)
ENDIF(ENABLE_NETWORKING)
IF(UNIX AND NOT APPLE)
IF(BUILD_KDE4 OR BUILD_KF5 OR BUILD_KF6)

View File

@ -64,26 +64,34 @@ SET(${PROJECT_NAME}_GLib_SRCS
RomDataFormat.cpp
RpFile_gio.cpp
is-supported.cpp
ProxyForUrl.cpp
RpGtkCpp.cpp
sort_funcs_common.c
config/CacheCleaner.cpp
config/UpdateChecker.cpp
)
SET(${PROJECT_NAME}_GLib_H
RomDataFormat.hpp
RpFile_gio.hpp
is-supported.hpp
ProxyForUrl.hpp
glib-compat.h
RpGtkCpp.hpp
sort_funcs_common.h
config/CacheCleaner.hpp
config/UpdateChecker.hpp
)
IF(ENABLE_NETWORKING)
# GLib common: Networking code, e.g. update checker
SET(${PROJECT_NAME}_GLib_NETWORKING_SRCS
ProxyForUrl.cpp
config/UpdateChecker.cpp
)
SET(${PROJECT_NAME}_GLib_NETWORKING_H
ProxyForUrl.hpp
config/UpdateChecker.hpp
)
ENDIF(ENABLE_NETWORKING)
# Sources and headers
SET(${PROJECT_NAME}_SRCS
RomDataView.cpp
@ -259,8 +267,8 @@ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.gtk.h.in" "${CMAKE_CURRENT_BI
IF(BUILD_XFCE OR BUILD_GTK3 OR BUILD_GTK4)
# GLib common library
ADD_LIBRARY(rom-properties-glib STATIC
${${PROJECT_NAME}_GLib_SRCS}
${${PROJECT_NAME}_GLib_H}
${${PROJECT_NAME}_GLib_SRCS} ${${PROJECT_NAME}_GLib_H}
${${PROJECT_NAME}_GLib_NETWORKING_SRCS} ${${PROJECT_NAME}_GLib_NETWORKING_H}
)
# Exclude from ALL builds; enable PIC.
SET_TARGET_PROPERTIES(rom-properties-glib PROPERTIES

View File

@ -2,17 +2,21 @@
* ROM Properties Page shell extension. (GTK+ common) *
* CreateThumbnail.cpp: Thumbnail creator for wrapper programs. *
* *
* Copyright (c) 2017-2024 by David Korth. *
* Copyright (c) 2017-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
#include "stdafx.h"
#include "config.gtk.h"
#include "CreateThumbnail.hpp"
#include "check-uid.h"
#include "ProxyForUrl.hpp"
#include "RpGtk.h"
#ifdef ENABLE_NETWORKING
# include "ProxyForUrl.hpp"
#endif /* ENABLE_NETWORKING */
// Other rom-properties libraries
#include "libromdata/RomDataFactory.hpp"
#include "librpfile/FileSystem.hpp"
@ -120,7 +124,12 @@ public:
*/
inline string proxyForUrl(const char *url) const final
{
#ifdef ENABLE_NETWORKING
return ::proxyForUrl(url);
#else /* !ENABLE_NETWORKING */
RP_UNUSED(url);
return {};
#endif /* ENABLE_NETWORKING */
}
/**

View File

@ -2,7 +2,7 @@
* ROM Properties Page shell extension. (GTK common) *
* config.gtk.h.in: GTK common frontend configuration. (source file) *
* *
* Copyright (c) 2017-2023 by David Korth. *
* Copyright (c) 2017-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
@ -30,3 +30,6 @@
/* Define to 1 if achievements are enabled. */
#cmakedefine ENABLE_ACHIEVEMENTS 1
/* Define to 1 if networking is enabled. */
#cmakedefine ENABLE_NETWORKING 1

View File

@ -2,16 +2,19 @@
* ROM Properties Page shell extension. (GTK+ common) *
* AboutTab.cpp: About tab for rp-config. *
* *
* Copyright (c) 2017-2024 by David Korth. *
* Copyright (c) 2017-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
#include "stdafx.h"
#include "config.librpbase.h"
#include "config.gtk.h"
#include "AboutTab.hpp"
#include "RpConfigTab.h"
#include "UpdateChecker.hpp"
#ifdef ENABLE_NETWORKING
# include "UpdateChecker.hpp"
#endif /* ENABLE_NETWORKING */
#include "gtk-compat.h"
#include "RpGtk.h"
@ -51,11 +54,11 @@ typedef GtkVBox super;
# define GTK_TYPE_SUPER GTK_TYPE_VBOX
#endif /* GTK_CHECK_VERSION(3,0,0) */
#if GTK_CHECK_VERSION(3,1,6)
#if defined(ENABLE_NETWORKING) && GTK_CHECK_VERSION(3,1,6)
// NOTE: Update check requires GtkOverlay, which was
// added in GTK+ 3.2.0 (3.1.6).
# define ENABLE_UPDATE_CHECK 1
#endif /* !GTK_CHECK_VERSION(3,1,6) */
#endif /* defined(ENABLE_NETWORKING) && GTK_CHECK_VERSION(3,1,6) */
// RpAboutTab class
struct _RpAboutTabClass {
@ -308,7 +311,11 @@ rp_about_tab_init(RpAboutTab *tab)
gtk_box_append(GTK_BOX(hboxTitle), tab->imgLogo);
gtk_box_append(GTK_BOX(hboxTitle), tab->lblTitle);
# ifdef ENABLE_UPDATE_CHECK
gtk_box_append(GTK_BOX(tab), ovlTitle); // contains hboxTitle
# else /* !ENABLE_UPDATE_CHECK */
gtk_box_append(GTK_BOX(tab), hboxTitle);
# endif /* ENABLE_UPDATE_CHECK */
gtk_box_append(GTK_BOX(tab), tabWidget);
#else /* !GTK_CHECK_VERSION(4,0,0) */
@ -318,7 +325,7 @@ rp_about_tab_init(RpAboutTab *tab)
# ifndef RP_USE_GTK_ALIGNMENT
GTK_WIDGET_HALIGN_CENTER(hboxTitle);
# ifdef ENABLE_UPDATE_CHECK
gtk_box_pack_start(GTK_BOX(tab), ovlTitle, false, false, 0);
gtk_box_pack_start(GTK_BOX(tab), ovlTitle, false, false, 0); // contains hboxTitle
# else /* !ENABLE_UPDATE_CHECK */
gtk_box_pack_start(GTK_BOX(tab), hboxTitle, false, false, 0);
# endif /* ENABLE_UPDATE_CHECK */

View File

@ -22,11 +22,11 @@ SET(${PROJECT_NAME}_SRCS
ListDataSortProxyModel.cpp
LanguageComboBox.cpp
OptionsMenuButton.cpp
ProxyForUrl.cpp
RomDataFormat.cpp
ISpriteSheet.cpp
AchSpriteSheet.cpp
FlagSpriteSheet.cpp
config/stub-export.cpp
config/ConfigDialog.cpp
config/ITab.cpp
@ -39,7 +39,6 @@ SET(${PROJECT_NAME}_SRCS
config/AchievementsTab.cpp
config/AchievementsItemDelegate.cpp
config/AboutTab.cpp
config/UpdateChecker.cpp
)
SET(${PROJECT_NAME}_H
plugins/RomPropertiesDialogPlugin.hpp
@ -59,12 +58,12 @@ SET(${PROJECT_NAME}_H
ListDataSortProxyModel.hpp
LanguageComboBox.hpp
OptionsMenuButton.hpp
ProxyForUrl.hpp
check-uid.hpp
RomDataFormat.hpp
ISpriteSheet.hpp
AchSpriteSheet.hpp
FlagSpriteSheet.hpp
config/ConfigDialog.hpp
config/ITab.hpp
config/ImageTypesTab.hpp
@ -76,7 +75,6 @@ SET(${PROJECT_NAME}_H
config/AchievementsTab.hpp
config/AchievementsItemDelegate.hpp
config/AboutTab.hpp
config/UpdateChecker.hpp
)
SET(${PROJECT_NAME}_UIS
RomDataView.ui
@ -157,6 +155,21 @@ IF(ENABLE_ACHIEVEMENTS)
SET(${PROJECT_NAME}-notify_H AchQtDBus.hpp)
ENDIF(ENABLE_ACHIEVEMENTS)
IF(ENABLE_NETWORKING)
# Networking code, e.g. update checker
# TODO: -networking_SRCS?
SET(${PROJECT_NAME}_SRCS
${${PROJECT_NAME}_SRCS}
ProxyForUrl.cpp
config/UpdateChecker.cpp
)
SET(${PROJECT_NAME}_H
${${PROJECT_NAME}_H}
ProxyForUrl.hpp
config/UpdateChecker.hpp
)
ENDIF(ENABLE_NETWORKING)
# RpFile_kio requires KDE Frameworks 5.
# FIXME: Dolphin ends up hanging for some reason...
#SET(${PROJECT_NAME}_SRCS ${${PROJECT_NAME}_SRCS} RpFile_kio.cpp)

View File

@ -2,7 +2,7 @@
* ROM Properties Page shell extension. (KDE) *
* config.kde.h.in: KDE frontend configuration. (source file) *
* *
* Copyright (c) 2020-2023 by David Korth. *
* Copyright (c) 2020-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
@ -19,3 +19,6 @@
/* Define to 1 if the KIOGui/KIO/ThumbnailCreator header file is available. */
#cmakedefine HAVE_KIOGUI_KIO_THUMBNAILCREATOR_H 1
/* Define to 1 if networking is enabled. */
#cmakedefine ENABLE_NETWORKING 1

View File

@ -2,12 +2,13 @@
* ROM Properties Page shell extension. (KDE) *
* AboutTab.hpp: About tab for rp-config. *
* *
* Copyright (c) 2016-2024 by David Korth. *
* Copyright (c) 2016-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
#include "stdafx.h"
#include "config.librpbase.h"
#include "config.kde.h"
#include "AboutTab.hpp"
#include "UpdateChecker.hpp"
@ -91,18 +92,20 @@ public:
*/
void init(void);
#ifdef ENABLE_NETWORKING
public:
/**
* Check for updates.
*/
void checkForUpdates(void);
public:
// Update checker object and thread.
QThread thrUpdate;
UpdateChecker updChecker;
// Checked for updates yet?
bool checkedForUpdates;
#endif /* ENABLE_NETWORKING */
};
/** AboutTabPrivate **/
@ -116,9 +119,12 @@ public:
AboutTabPrivate::AboutTabPrivate(AboutTab *q)
: q_ptr(q)
#ifdef ENABLE_NETWORKING
, thrUpdate(q)
, checkedForUpdates(false)
#endif /* ENABLE_NETWORKING */
{
#ifdef ENABLE_NETWORKING
thrUpdate.setObjectName(QLatin1String("thrUpdate"));
updChecker.setObjectName(QLatin1String("updChecker"));
@ -135,10 +141,12 @@ AboutTabPrivate::AboutTabPrivate(AboutTab *q)
&updChecker, SLOT(run()));
QObject::connect(&updChecker, SIGNAL(finished()),
&thrUpdate, SLOT(quit()));
#endif /* ENABLE_NETWORKING */
}
AboutTabPrivate::~AboutTabPrivate()
{
#ifdef ENABLE_NETWORKING
if (thrUpdate.isRunning()) {
// Make sure the thread is stopped.
thrUpdate.quit();
@ -148,6 +156,7 @@ AboutTabPrivate::~AboutTabPrivate()
thrUpdate.terminate();
}
}
#endif /* ENABLE_NETWORKING */
}
/**
@ -571,6 +580,7 @@ void AboutTabPrivate::init(void)
initSupportTab();
}
#ifdef ENABLE_NETWORKING
/**
* Check for updates.
*/
@ -583,6 +593,7 @@ void AboutTabPrivate::checkForUpdates(void)
ui.lblUpdateCheck->setText(QC_("AboutTab", "Checking for updates..."));
thrUpdate.start();
}
#endif /* ENABLE_NETWORKING */
/** AboutTab **/
@ -629,11 +640,13 @@ void AboutTab::showEvent(QShowEvent *event)
{
Q_UNUSED(event)
#ifdef ENABLE_NETWORKING
Q_D(AboutTab);
if (!d->checkedForUpdates) {
d->checkedForUpdates = true;
d->checkForUpdates();
}
#endif /* ENABLE_NETWORKING */
// Pass the event to the base class.
super::showEvent(event);
@ -641,6 +654,9 @@ void AboutTab::showEvent(QShowEvent *event)
/** UpdateChecker slots **/
// NOTE: moc doesn't handle conditional definitions of slots,
// so these will always be defined, even in no-network builds.
/**
* An error occurred while trying to retrieve the update version.
* TODO: Error code?
@ -648,11 +664,15 @@ void AboutTab::showEvent(QShowEvent *event)
*/
void AboutTab::updChecker_error(const QString &error)
{
#ifdef ENABLE_NETWORKING
Q_D(AboutTab);
// tr: Error message template. (Qt version, with formatting)
const QString errTemplate = QC_("ConfigDialog", "<b>ERROR:</b> %1");
d->ui.lblUpdateCheck->setText(errTemplate.arg(error));
#else /* !ENABLE_NETWORKING */
Q_UNUSED(error)
#endif /* ENABLE_NETWORKING */
}
/**
@ -661,6 +681,7 @@ void AboutTab::updChecker_error(const QString &error)
*/
void AboutTab::updChecker_retrieved(quint64 updateVersion)
{
#ifdef ENABLE_NETWORKING
Q_D(AboutTab);
// Our version. (ignoring the development flag)
@ -694,4 +715,7 @@ void AboutTab::updChecker_retrieved(quint64 updateVersion)
}
d->ui.lblUpdateCheck->setText(U82Q(sVersionLabel));
#else /* !ENABLE_NETWORKING */
Q_UNUSED(updateVersion)
#endif /* ENABLE_NETWORKING */
}

View File

@ -39,7 +39,7 @@ ENDIF(QT4_FOUND)
IF(HAVE_QtDBus)
# FIXME: Broken on Qt4.
IF(0)
QT4_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_SRCS
QT4_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_NM_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../../dbus/org.freedesktop.NetworkManager.xml"
)
# NOTE: Setting CMAKE_POLICY(SET CMP0071 NEW) causes the generated D-Bus .moc
@ -49,7 +49,7 @@ IF(HAVE_QtDBus)
IF(HAVE_QtDBus_NOTIFY)
STRING(REGEX REPLACE "([^;]+)" "../\\1" ${PROJECT_NAME}-notify_SRCS "${rom-properties-kde-notify_SRCS}")
STRING(REGEX REPLACE "([^;]+)" "../\\1" ${PROJECT_NAME}-notify_H "${rom-properties-kde-notify_H}")
QT4_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_SRCS_2
QT4_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_NOTIFY_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../../dbus/org.freedesktop.Notifications.xml"
)
# NOTE: Setting CMAKE_POLICY(SET CMP0071 NEW) causes the generated D-Bus .moc
@ -63,8 +63,8 @@ SET(${PROJECT_NAME}_SRCS
${${PROJECT_NAME}_SRCS}
${${PROJECT_NAME}_RomThumbCreator_SRCS}
${${PROJECT_NAME}-notify_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_SRCS_2}
${${PROJECT_NAME}_DBUS_IFACE_NM_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_NOTIFY_SRCS}
${${PROJECT_NAME}_RCC_O}
PluginFactoryKDE4.cpp
)

View File

@ -46,13 +46,13 @@ IF(Qt5Core_FOUND)
)
ENDIF(Qt5Core_FOUND)
IF(HAVE_QtDBus)
QT5_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_SRCS
QT5_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_NM_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../../dbus/org.freedesktop.NetworkManager.xml"
)
IF(HAVE_QtDBus_NOTIFY)
STRING(REGEX REPLACE "([^;]+)" "../\\1" ${PROJECT_NAME}-notify_SRCS "${rom-properties-kde-notify_SRCS}")
STRING(REGEX REPLACE "([^;]+)" "../\\1" ${PROJECT_NAME}-notify_H "${rom-properties-kde-notify_H}")
QT5_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_SRCS_2
QT5_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_NOTIFY_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../../dbus/org.freedesktop.Notifications.xml"
)
ENDIF(HAVE_QtDBus_NOTIFY)
@ -65,8 +65,8 @@ SET(${PROJECT_NAME}_SRCS
${${PROJECT_NAME}_RomThumbCreator_SRCS}
${rom-properties-kio5_SRCS}
${${PROJECT_NAME}-notify_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_SRCS_2}
${${PROJECT_NAME}_DBUS_IFACE_NM_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_NOTIFY_SRCS}
${${PROJECT_NAME}_RCC_O}
PluginFactoryKF5.cpp
)
@ -143,6 +143,9 @@ IF(BUILD_KF5)
../RpQImageBackend.hpp
../RpQUrl.hpp
../RpQt.hpp
# NetworkManager D-Bus interface
${${PROJECT_NAME}_DBUS_IFACE_NM_SRCS}
)
# TODO: Enable PCH?
#IF(ENABLE_PCH)

View File

@ -36,13 +36,13 @@ IF(Qt6Core_FOUND)
)
ENDIF(Qt6Core_FOUND)
IF(HAVE_QtDBus)
QT6_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_SRCS
QT6_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_NM_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../../dbus/org.freedesktop.NetworkManager.xml"
)
IF(HAVE_QtDBus_NOTIFY)
STRING(REGEX REPLACE "([^;]+)" "../\\1" ${PROJECT_NAME}-notify_SRCS "${rom-properties-kde-notify_SRCS}")
STRING(REGEX REPLACE "([^;]+)" "../\\1" ${PROJECT_NAME}-notify_H "${rom-properties-kde-notify_H}")
QT6_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_SRCS_2
QT6_ADD_DBUS_INTERFACES(${PROJECT_NAME}_DBUS_IFACE_NOTIFY_SRCS
"${CMAKE_CURRENT_SOURCE_DIR}/../../dbus/org.freedesktop.Notifications.xml"
)
ENDIF(HAVE_QtDBus_NOTIFY)
@ -53,8 +53,8 @@ SET(${PROJECT_NAME}_SRCS
${${PROJECT_NAME}_SRCS}
${rom-properties-kio6_SRCS}
${${PROJECT_NAME}-notify_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_SRCS_2}
${${PROJECT_NAME}_DBUS_IFACE_NM_SRCS}
${${PROJECT_NAME}_DBUS_IFACE_NOTIFY_SRCS}
${${PROJECT_NAME}_RCC_O}
PluginFactoryKF6.cpp
)
@ -129,6 +129,9 @@ IF(BUILD_KF6)
../RpQImageBackend.hpp
../RpQUrl.hpp
../RpQt.hpp
# NetworkManager D-Bus interface
${${PROJECT_NAME}_DBUS_IFACE_NM_SRCS}
)
# TODO: Enable PCH?
#IF(ENABLE_PCH)

View File

@ -2,13 +2,17 @@
* ROM Properties Page shell extension. (KDE4/KF5) *
* RomThumbCreator_p.hpp: Thumbnail creator. (PRIVATE CLASS) *
* *
* Copyright (c) 2016-2024 by David Korth. *
* Copyright (c) 2016-2025 by David Korth. *
* SPDX-License-Identifier: GPL-2.0-or-later *
***************************************************************************/
#pragma once
#include "ProxyForUrl.hpp"
#include "config.kde.h"
#ifdef ENABLE_NETWORKING
# include "ProxyForUrl.hpp"
#endif /* ENABLE_NETWORKING */
// Qt includes
#include <QtGui/QImage>
@ -101,7 +105,12 @@ public:
*/
inline std::string proxyForUrl(const char *url) const final
{
#ifdef ENABLE_NETWORKING
return ::proxyForUrl(url);
#else /* !ENABLE_NETWORKING */
Q_UNUSED(url)
return {};
#endif /* ENABLE_NETWORKING */
}
/**

View File

@ -401,18 +401,23 @@ IF(ENABLE_DECRYPTION)
)
ENDIF(ENABLE_DECRYPTION)
# OS-specific sources.
IF(WIN32)
SET(${PROJECT_NAME}_OS_SRCS img/ExecRpDownload_win32.cpp)
IF(RP_LIBROMDATA_IS_DLL)
SET(${PROJECT_NAME}_RC res/resource.rc)
ENDIF(RP_LIBROMDATA_IS_DLL)
ELSEIF(UNIX)
SET(${PROJECT_NAME}_OS_SRCS img/ExecRpDownload_posix.cpp)
ELSE()
# Dummy implementation for unsupported systems.
SET(${PROJECT_NAME}_OS_SRCS img/ExecRpDownload_dummy.cpp)
ENDIF()
# Network-related sources
IF(ENABLE_NETWORKING)
IF(WIN32)
SET(${PROJECT_NAME}_NETWORKING_SRCS img/ExecRpDownload_win32.cpp)
ELSEIF(UNIX)
SET(${PROJECT_NAME}_NETWORKING_SRCS img/ExecRpDownload_posix.cpp)
ENDIF()
ENDIF(ENABLE_NETWORKING)
IF(NOT ${PROJECT_NAME}_NETWORKING_SRCS)
# Dummy implementation for unsupported systems, or if networking is disabled.
SET(${PROJECT_NAME}_NETWORKING_SRCS img/ExecRpDownload_dummy.cpp)
ENDIF(NOT ${PROJECT_NAME}_NETWORKING_SRCS)
# Windows resource file (for RomData DLL builds only)
IF(WIN32 AND RP_LIBROMDATA_IS_DLL)
SET(${PROJECT_NAME}_RC res/resource.rc)
ENDIF(WIN32 AND RP_LIBROMDATA_IS_DLL)
# Optimized sources.
INCLUDE(CPUInstructionSetFlags)
@ -522,7 +527,7 @@ ENDIF(WIN32)
ADD_LIBRARY(${PROJECT_NAME} ${${PROJECT_NAME}_LINKAGE}
${${PROJECT_NAME}-DELAYLOAD_SRC} ${${PROJECT_NAME}-DELAYLOAD_H}
${${PROJECT_NAME}_SRCS} ${${PROJECT_NAME}_H}
${${PROJECT_NAME}_OS_SRCS} ${${PROJECT_NAME}_OS_H}
${${PROJECT_NAME}_NETWORKING_SRCS}
${${PROJECT_NAME}_CRYPTO_SRCS} ${${PROJECT_NAME}_CRYPTO_H}
${${PROJECT_NAME}_IFUNC_SRCS}
${${PROJECT_NAME}_MMX_SRCS}