diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fd09dbe8b..dd169046ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,6 @@ option(USE_SHARED_GTEST "Use shared gtest library if found" OFF) option(USE_UPNP "Enables UPnP port mapping support" ON) option(DISABLE_WX "Disable wxWidgets (use Qt or CLI interface)" OFF) option(ENABLE_QT2 "Enable Qt2 (use the other experimental Qt interface)" OFF) -option(ENABLE_PCH "Use PCH to speed up compilation" ON) option(ENABLE_LTO "Enables Link Time Optimization" OFF) option(ENABLE_GENERIC "Enables generic build that should run on any little-endian host" OFF) option(ENABLE_HEADLESS "Enables running Dolphin as a headless variant" OFF) @@ -122,34 +121,6 @@ endif() # as defined above. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Binaries) -# Precompiled header support for MSVC: -# Call this after setting the source list (and don't add the source file used -# to generate the pch file, this will be done here automatically) -function(enable_precompiled_headers PRECOMPILED_HEADER SOURCE_FILE SOURCE_VARIABLE_NAME) - if(MSVC) - set(files ${${SOURCE_VARIABLE_NAME}}) - - # Generate precompiled header translation unit - get_filename_component(pch_basename ${PRECOMPILED_HEADER} NAME_WE) - set(pch_abs ${CMAKE_CURRENT_SOURCE_DIR}/${PRECOMPILED_HEADER}) - set(pch_unity ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}) - set_source_files_properties(${pch_unity} PROPERTIES COMPILE_FLAGS - "/Yc\"${pch_abs}\"") - - # Update properties of source files to use the precompiled header. - # Additionally, force the inclusion of the precompiled header at - # beginning of each source file. - foreach(source_file ${files} ) - set_source_files_properties(${source_file} PROPERTIES COMPILE_FLAGS - "/Yu\"${pch_abs}\" /FI\"${pch_abs}\"") - endforeach(source_file) - - # Finally, update the source file collection to contain the - # precompiled header translation unit - set(${SOURCE_VARIABLE_NAME} ${pch_unity} ${${SOURCE_VARIABLE_NAME}} PARENT_SCOPE) - endif(MSVC) -endfunction(enable_precompiled_headers) - # setup CCache include(CCache) @@ -1006,7 +977,6 @@ if(NOT DISABLE_WX) set(wxWidgets_FOUND TRUE) set(wxWidgets_LIBRARIES "wx") endif(wxWidgets_FOUND) - add_definitions(-DHAVE_WX=1) endif(NOT DISABLE_WX) if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|NetBSD") diff --git a/Externals/curl/lib/CMakeLists.txt b/Externals/curl/lib/CMakeLists.txt index b5bce4964c..00b6a7c2cc 100644 --- a/Externals/curl/lib/CMakeLists.txt +++ b/Externals/curl/lib/CMakeLists.txt @@ -1,6 +1,7 @@ -set(LIB_NAME libcurl) +if(NOT CMAKE_SYSTEM_NAME MATCHES "Windows") + add_definitions(-DHAVE_CONFIG_H) +endif() -add_definitions(-DHAVE_CONFIG_H) include_directories(.) file(GLOB SRCS *.c vauth/*.c vtls/*.c) @@ -11,3 +12,4 @@ add_library( ) target_link_libraries(curl ${MBEDTLS_LIBRARIES}) +target_compile_definitions(curl PUBLIC CURL_STATICLIB PRIVATE CURL_DISABLE_LDAP) diff --git a/Externals/wxWidgets3/CMakeLists.txt b/Externals/wxWidgets3/CMakeLists.txt index 1f09e3318e..1e6eda5ad1 100644 --- a/Externals/wxWidgets3/CMakeLists.txt +++ b/Externals/wxWidgets3/CMakeLists.txt @@ -296,7 +296,7 @@ set(SRCS_GENERIC "src/generic/infobar.cpp" "src/generic/laywin.cpp" "src/generic/listbkg.cpp" - "src/generic/listctrl.cpp" + "src/generic/logg.cpp" #"src/generic/markuptext.cpp" #"src/generic/mask.cpp" @@ -344,6 +344,7 @@ set(SRCS_GENERICGTK "src/generic/activityindicator.cpp" "src/generic/icon.cpp" "src/generic/imaglist.cpp" + "src/generic/listctrl.cpp" "src/generic/paletteg.cpp" "src/generic/preferencesg.cpp") @@ -358,7 +359,8 @@ set(SRCS_GENERICOSX "src/generic/colrdlgg.cpp" "src/generic/dirdlgg.cpp" "src/generic/filedlgg.cpp" - "src/generic/fontpickerg.cpp") + "src/generic/fontpickerg.cpp" + "src/generic/listctrl.cpp") set(SRCS_GTK "src/aui/tabartgtk.cpp" @@ -890,6 +892,5 @@ add_definitions(-DWXBUILDING) # wxWidgets warnings are not our problem. add_definitions(-w) -#enable_precompiled_headers(include/wx/wxprec.h src/common/dummy.cpp SRCS) add_library(wx STATIC ${PNG_SRCS} ${SRCS}) target_link_libraries(wx ${LIBS}) 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 ") -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 #include #include 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 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 + #include #include #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 +#include #include #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 #include +#include #include #include #include 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 #include #include -#if defined(__unix__) || defined(__unix) || defined(__APPLE__) -#include -#endif -#ifdef _WIN32 -#include -#endif #include #include #include @@ -31,6 +25,24 @@ #include #include +#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 +#endif +#ifdef _WIN32 +#include +#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 +#include + // 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 #include -#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 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 #include -#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 #include +#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 #include -#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 // NOLINT -#if defined(HAVE_WX) && HAVE_WX -#include -#include -#include -#endif - #if defined(HAVE_XRANDR) && HAVE_XRANDR #include #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 @@ PSAPI_VERSION=1;_M_X86=1;%(PreprocessorDefinitions) SFML_STATIC;%(PreprocessorDefinitions) CURL_STATICLIB;%(PreprocessorDefinitions) + HAVE_OPENAL=1;%(PreprocessorDefinitions) + HAVE_PORTAUDIO=1;%(PreprocessorDefinitions) _ARCH_64=1;_M_X86_64=1;%(PreprocessorDefinitions)