summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2017-01-24 14:35:05 +0100
committerGitHub <noreply@github.com>2017-01-24 14:35:05 +0100
commit63f56ccd023af0ffeb7bac64e9c91b86760d5aa3 (patch)
tree91e66333eb3c2bdf50b37f06199b9901cd6c9110 /Source
parent221be63cb4b8615f3b889807cefb0d84a8211d61 (diff)
parent803ea7b14365c05b437dfb616c7c4cc1b891ba16 (diff)
Merge pull request #4741 from Orphis/cmake_cleanup
CMake cleanup
Diffstat (limited to 'Source')
-rw-r--r--Source/Android/app/build.gradle2
-rw-r--r--Source/CMakeLists.txt43
-rw-r--r--Source/Core/AudioCommon/OpenALStream.cpp1
-rw-r--r--Source/Core/Common/Common.h6
-rw-r--r--Source/Core/Common/x64CPUDetect.cpp2
-rw-r--r--Source/Core/Core/FifoPlayer/FifoDataFile.cpp1
-rw-r--r--Source/Core/Core/PowerPC/JitCommon/JitCache.h1
-rw-r--r--Source/Core/DolphinWX/Frame.cpp39
-rw-r--r--Source/Core/DolphinWX/ISOFile.h7
-rw-r--r--Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp9
-rw-r--r--Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp5
-rw-r--r--Source/Core/DolphinWX/X11Utils.cpp4
-rw-r--r--Source/Core/DolphinWX/X11Utils.h8
-rw-r--r--Source/VSProps/Base.props2
14 files changed, 38 insertions, 92 deletions
diff --git a/Source/Android/app/build.gradle b/Source/Android/app/build.gradle
index f82df2b1d5..359065102c 100644
--- a/Source/Android/app/build.gradle
+++ b/Source/Android/app/build.gradle
@@ -65,7 +65,7 @@ android {
defaultConfig {
externalNativeBuild {
cmake {
- arguments "-DANDROID_STL=c++_static", "-DCMAKE_BUILD_TYPE=RelWithDebInfo", "-DENABLE_PCH=OFF" // , "-DENABLE_GENERIC=ON"
+ arguments "-DANDROID_STL=c++_static", "-DCMAKE_BUILD_TYPE=RelWithDebInfo" // , "-DENABLE_GENERIC=ON"
abiFilters "arm64-v8a" //, "armeabi-v7a", "x86_64", "x86"
}
}
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 46f2a9c9cc..a13a96d70b 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -8,52 +8,9 @@ endif()
add_definitions(-D__STDC_LIMIT_MACROS)
add_definitions(-D__STDC_CONSTANT_MACROS)
-set(CMAKE_FAKELANG_CREATE_STATIC_LIBRARY "touch <TARGET>")
-if(ENABLE_PCH)
- # This is actually a .h file, but trick cmake into compiling it as a source file
- set(pch_out_filename "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/pch.dir/pch.h")
- if (ANDROID)
- set(pch_lib_filename "${LIBRARY_OUTPUT_PATH}/libpch.a")
- else()
- set(pch_lib_filename "${CMAKE_CURRENT_BINARY_DIR}/libpch.a")
- endif()
- set(pch_src_filename "${CMAKE_CURRENT_SOURCE_DIR}/PCH/pch.h")
-
- if(APPLE)
- set(type objective-c++-header)
- else()
- set(type c++-header)
- endif()
-
- set_source_files_properties(
- PCH/pch.h PROPERTIES
- COMPILE_FLAGS "-x ${type}"
- HEADER_FILE_ONLY 0
- LANGUAGE CXX)
-
- add_library(pch STATIC PCH/pch.h)
-
- add_custom_command(
- TARGET pch
- PRE_LINK
- COMMAND ln -fs "${pch_out_filename}.o" "${pch_out_filename}.gch"
- COMMAND ln -fs "${pch_out_filename}.o" "${pch_out_filename}.pch"
- COMMAND cp "${pch_src_filename}" "${pch_out_filename}")
-
- set_target_properties(
- pch PROPERTIES
- LINKER_LANGUAGE FAKELANG)
-endif(ENABLE_PCH)
macro(add_dolphin_library lib srcs libs)
add_library(${lib} STATIC ${srcs})
target_link_libraries(${lib} ${libs})
- if(ENABLE_PCH)
- add_dependencies(${lib} pch)
- set_source_files_properties(
- ${srcs} PROPERTIES
- COMPILE_FLAGS "-include '${pch_out_filename}'"
- OBJECT_DEPENDS "${pch_lib_filename}")
- endif(ENABLE_PCH)
endmacro(add_dolphin_library)
add_subdirectory(Core)
diff --git a/Source/Core/AudioCommon/OpenALStream.cpp b/Source/Core/AudioCommon/OpenALStream.cpp
index cdbe086450..aee276e691 100644
--- a/Source/Core/AudioCommon/OpenALStream.cpp
+++ b/Source/Core/AudioCommon/OpenALStream.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
+#include <climits>
#include <cstring>
#include <thread>
diff --git a/Source/Core/Common/Common.h b/Source/Core/Common/Common.h
index a48203a874..ff9cea5104 100644
--- a/Source/Core/Common/Common.h
+++ b/Source/Core/Common/Common.h
@@ -37,12 +37,6 @@ extern const std::string scm_distributor_str;
// Memory leak checks
#define CHECK_HEAP_INTEGRITY()
-// Since they are always around on Windows
-#define HAVE_WX 1
-#define HAVE_OPENAL 1
-
-#define HAVE_PORTAUDIO 1
-
// Debug definitions
#if defined(_DEBUG)
#include <crtdbg.h>
diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp
index b35a91b50e..5e655b1850 100644
--- a/Source/Core/Common/x64CPUDetect.cpp
+++ b/Source/Core/Common/x64CPUDetect.cpp
@@ -12,6 +12,8 @@
#ifndef _WIN32
#ifdef __FreeBSD__
+#include <unistd.h>
+
#include <machine/cpufunc.h>
#include <sys/types.h>
#endif
diff --git a/Source/Core/Core/FifoPlayer/FifoDataFile.cpp b/Source/Core/Core/FifoPlayer/FifoDataFile.cpp
index 9d25ba81f2..231f8cb82d 100644
--- a/Source/Core/Core/FifoPlayer/FifoDataFile.cpp
+++ b/Source/Core/Core/FifoPlayer/FifoDataFile.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <algorithm>
+#include <cstring>
#include <string>
#include "Common/FileUtil.h"
diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/PowerPC/JitCommon/JitCache.h
index 85ae3bfbb8..ea053a3dfa 100644
--- a/Source/Core/Core/PowerPC/JitCommon/JitCache.h
+++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.h
@@ -6,6 +6,7 @@
#include <array>
#include <bitset>
+#include <cstring>
#include <functional>
#include <map>
#include <memory>
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index 9bb98c5f62..817933cd63 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -10,12 +10,6 @@
#include <string>
#include <utility>
#include <vector>
-#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
-#include <signal.h>
-#endif
-#ifdef _WIN32
-#include <windows.h>
-#endif
#include <wx/aui/auibook.h>
#include <wx/aui/framemanager.h>
#include <wx/filename.h>
@@ -31,6 +25,24 @@
#include <wx/thread.h>
#include <wx/toolbar.h>
+#include "DolphinWX/Config/ConfigMain.h"
+#include "DolphinWX/Debugger/BreakpointDlg.h"
+#include "DolphinWX/Debugger/CodeWindow.h"
+#include "DolphinWX/Debugger/MemoryCheckDlg.h"
+#include "DolphinWX/GameListCtrl.h"
+#include "DolphinWX/Globals.h"
+#include "DolphinWX/LogWindow.h"
+#include "DolphinWX/Main.h"
+#include "DolphinWX/TASInputDlg.h"
+#include "DolphinWX/WxUtils.h"
+
+#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
+#include <signal.h>
+#endif
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
#include "AudioCommon/AudioCommon.h"
#include "Common/CommonTypes.h"
@@ -51,17 +63,6 @@
#include "Core/Movie.h"
#include "Core/State.h"
-#include "DolphinWX/Config/ConfigMain.h"
-#include "DolphinWX/Debugger/BreakpointDlg.h"
-#include "DolphinWX/Debugger/CodeWindow.h"
-#include "DolphinWX/Debugger/MemoryCheckDlg.h"
-#include "DolphinWX/GameListCtrl.h"
-#include "DolphinWX/Globals.h"
-#include "DolphinWX/LogWindow.h"
-#include "DolphinWX/Main.h"
-#include "DolphinWX/TASInputDlg.h"
-#include "DolphinWX/WxUtils.h"
-
#include "InputCommon/GCPadStatus.h"
#include "VideoCommon/OnScreenDisplay.h"
@@ -70,6 +71,10 @@
#include "VideoCommon/VideoConfig.h"
#if defined(HAVE_X11) && HAVE_X11
+
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+
// X11Utils nastiness that's only used here
namespace X11Utils
{
diff --git a/Source/Core/DolphinWX/ISOFile.h b/Source/Core/DolphinWX/ISOFile.h
index 836b453714..d793860759 100644
--- a/Source/Core/DolphinWX/ISOFile.h
+++ b/Source/Core/DolphinWX/ISOFile.h
@@ -11,10 +11,8 @@
#include "Common/Common.h"
-#if defined(HAVE_WX) && HAVE_WX
#include <wx/bitmap.h>
#include <wx/image.h>
-#endif
namespace DiscIO
{
@@ -60,12 +58,9 @@ public:
u64 GetVolumeSize() const { return m_VolumeSize; }
// 0 is the first disc, 1 is the second disc
u8 GetDiscNumber() const { return m_disc_number; }
-#if defined(HAVE_WX) && HAVE_WX
// NOTE: Banner image is at the original resolution, use WxUtils::ScaleImageToBitmap
// to display it
const wxImage& GetBannerImage() const { return m_image; }
-#endif
-
void DoState(PointerWrap& p);
private:
@@ -90,9 +85,7 @@ private:
DiscIO::BlobType m_blob_type;
u16 m_Revision;
-#if defined(HAVE_WX) && HAVE_WX
wxImage m_image;
-#endif
bool m_Valid;
std::vector<u8> m_pImage;
int m_ImageWidth, m_ImageHeight;
diff --git a/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp b/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
index 643b2fd959..8202c5b9a8 100644
--- a/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
+++ b/Source/Core/DolphinWX/NetPlay/NetPlaySetupFrame.cpp
@@ -14,10 +14,6 @@
#include <wx/stattext.h>
#include <wx/textctrl.h>
-#include "Common/FileUtil.h"
-#include "Common/IniFile.h"
-#include "Core/NetPlayClient.h"
-#include "Core/NetPlayServer.h"
#include "DolphinWX/Frame.h"
#include "DolphinWX/Main.h"
#include "DolphinWX/NetPlay/NetPlayLauncher.h"
@@ -25,6 +21,11 @@
#include "DolphinWX/NetPlay/NetWindow.h"
#include "DolphinWX/WxUtils.h"
+#include "Common/FileUtil.h"
+#include "Common/IniFile.h"
+#include "Core/NetPlayClient.h"
+#include "Core/NetPlayServer.h"
+
namespace
{
wxString GetTraversalLabelText(IniFile::Section& section)
diff --git a/Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp b/Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp
index cad10dce0f..3426c594f1 100644
--- a/Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp
+++ b/Source/Core/DolphinWX/NetPlay/PadMapDialog.cpp
@@ -7,11 +7,12 @@
#include <wx/sizer.h>
#include <wx/stattext.h>
+#include "DolphinWX/NetPlay/PadMapDialog.h"
+#include "DolphinWX/WxUtils.h"
+
#include "Core/NetPlayClient.h"
#include "Core/NetPlayProto.h"
#include "Core/NetPlayServer.h"
-#include "DolphinWX/NetPlay/PadMapDialog.h"
-#include "DolphinWX/WxUtils.h"
PadMapDialog::PadMapDialog(wxWindow* parent, NetPlayServer* server, NetPlayClient* client)
: wxDialog(parent, wxID_ANY, _("Controller Ports")), m_pad_mapping(server->GetPadMapping()),
diff --git a/Source/Core/DolphinWX/X11Utils.cpp b/Source/Core/DolphinWX/X11Utils.cpp
index d20f0500eb..7093e12492 100644
--- a/Source/Core/DolphinWX/X11Utils.cpp
+++ b/Source/Core/DolphinWX/X11Utils.cpp
@@ -13,13 +13,9 @@
extern char** environ;
-#if defined(HAVE_WX) && HAVE_WX
#include <algorithm>
#include <string>
-#include "DolphinWX/WxUtils.h"
-#endif
-
namespace X11Utils
{
bool ToggleFullscreen(Display* dpy, Window win)
diff --git a/Source/Core/DolphinWX/X11Utils.h b/Source/Core/DolphinWX/X11Utils.h
index c673e1aabd..1efaac5d66 100644
--- a/Source/Core/DolphinWX/X11Utils.h
+++ b/Source/Core/DolphinWX/X11Utils.h
@@ -12,12 +12,6 @@
// is terrible, but such is the life with Xlib.
#include <SFML/Network.hpp> // NOLINT
-#if defined(HAVE_WX) && HAVE_WX
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-#include <wx/arrstr.h>
-#endif
-
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
@@ -33,10 +27,8 @@
namespace X11Utils
{
bool ToggleFullscreen(Display* dpy, Window win);
-#if defined(HAVE_WX) && HAVE_WX
Window XWindowFromHandle(void* Handle);
Display* XDisplayFromHandle(void* Handle);
-#endif
void InhibitScreensaver(Display* dpy, Window win, bool suspend);
diff --git a/Source/VSProps/Base.props b/Source/VSProps/Base.props
index 66013cc4a9..0dbbdd59ff 100644
--- a/Source/VSProps/Base.props
+++ b/Source/VSProps/Base.props
@@ -55,6 +55,8 @@
<PreprocessorDefinitions>PSAPI_VERSION=1;_M_X86=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>SFML_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CURL_STATICLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>HAVE_OPENAL=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>HAVE_PORTAUDIO=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Platform)'=='x64'">_ARCH_64=1;_M_X86_64=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!--
Make sure we include a clean version of windows.h.