Merge pull request #4741 from Orphis/cmake_cleanup

CMake cleanup
This commit is contained in:
Markus Wick
2017-01-24 14:35:05 +01:00
committed by GitHub
17 changed files with 46 additions and 127 deletions

View File

@ -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"
}
}

View File

@ -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)

View File

@ -2,6 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <climits>
#include <cstring>
#include <thread>

View File

@ -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>

View File

@ -12,6 +12,8 @@
#ifndef _WIN32
#ifdef __FreeBSD__
#include <unistd.h>
#include <machine/cpufunc.h>
#include <sys/types.h>
#endif

View File

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <algorithm>
#include <cstring>
#include <string>
#include "Common/FileUtil.h"

View File

@ -6,6 +6,7 @@
#include <array>
#include <bitset>
#include <cstring>
#include <functional>
#include <map>
#include <memory>

View File

@ -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
{

View File

@ -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;

View File

@ -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)

View File

@ -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()),

View File

@ -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)

View File

@ -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);

View File

@ -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.