From 8bd41ad60625bc1daa721e2f6faca6872c21113b Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 3 Feb 2017 04:42:52 +0100 Subject: [PATCH 1/4] cmake: Add missing Windows link flags --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e4d510ce0..94f524ed45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,6 +196,11 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC") check_and_add_flag(EXCEPTIONS /EHsc) dolphin_compile_definitions(-D_DEBUG DEBUG_ONLY) + string(APPEND CMAKE_EXE_LINKER_FLAGS " /NXCOMPAT") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /BASE:0x00400000") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /DYNAMICBASE:NO") + string(APPEND CMAKE_EXE_LINKER_FLAGS " /FIXED") + # Only MSBuild needs this, other generators will compile one file at a time if(CMAKE_GENERATOR MATCHES "Visual Studio") add_compile_options("/MP") From 3842a9b71c0649e2718fa835a614429abbebf46b Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 3 Feb 2017 04:50:12 +0100 Subject: [PATCH 2/4] OpenAL: Move Windows binaries to lib folder and fix CMake detection The module FindOpenAL is looking for the dll in a folder called lib, not x64. This is only used on Windows x64, it's fine to remove the platform name. --- CMakeLists.txt | 3 +++ Externals/OpenAL/{x64 => lib}/OpenAL32.dll | Bin Externals/OpenAL/{x64 => lib}/OpenAL32.lib | Bin Source/Core/DolphinQt2/DolphinQt2.vcxproj | 4 ++-- Source/Core/DolphinWX/DolphinWX.vcxproj | 4 ++-- Source/UnitTests/UnitTests.vcxproj | 4 ++-- 6 files changed, 9 insertions(+), 6 deletions(-) rename Externals/OpenAL/{x64 => lib}/OpenAL32.dll (100%) rename Externals/OpenAL/{x64 => lib}/OpenAL32.lib (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94f524ed45..fce1d92b21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -484,6 +484,9 @@ else() endif() if(ENABLE_OPENAL) + if(WIN32) + set(ENV{OPENALDIR} ${CMAKE_CURRENT_LIST_DIR}/Externals/OpenAL) + endif() find_package(OpenAL) if(OPENAL_FOUND) add_definitions(-DHAVE_OPENAL=1) diff --git a/Externals/OpenAL/x64/OpenAL32.dll b/Externals/OpenAL/lib/OpenAL32.dll similarity index 100% rename from Externals/OpenAL/x64/OpenAL32.dll rename to Externals/OpenAL/lib/OpenAL32.dll diff --git a/Externals/OpenAL/x64/OpenAL32.lib b/Externals/OpenAL/lib/OpenAL32.lib similarity index 100% rename from Externals/OpenAL/x64/OpenAL32.lib rename to Externals/OpenAL/lib/OpenAL32.lib diff --git a/Source/Core/DolphinQt2/DolphinQt2.vcxproj b/Source/Core/DolphinQt2/DolphinQt2.vcxproj index a754927eba..722b678537 100644 --- a/Source/Core/DolphinQt2/DolphinQt2.vcxproj +++ b/Source/Core/DolphinQt2/DolphinQt2.vcxproj @@ -49,7 +49,7 @@ 0x00400000 false true - $(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories) + $(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\lib;%(AdditionalLibraryDirectories) iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies) Windows /NODEFAULTLIB:libcmt @@ -219,7 +219,7 @@ - + diff --git a/Source/Core/DolphinWX/DolphinWX.vcxproj b/Source/Core/DolphinWX/DolphinWX.vcxproj index 176f34cf51..81412afe65 100644 --- a/Source/Core/DolphinWX/DolphinWX.vcxproj +++ b/Source/Core/DolphinWX/DolphinWX.vcxproj @@ -40,7 +40,7 @@ 0x00400000 false true - $(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories) + $(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\lib;%(AdditionalLibraryDirectories) iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies) /NODEFAULTLIB:libcmt %(AdditionalOptions) /NODEFAULTLIB:libcmt %(AdditionalOptions) @@ -291,7 +291,7 @@ - + diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj index f7772c3482..c2ea4ec325 100644 --- a/Source/UnitTests/UnitTests.vcxproj +++ b/Source/UnitTests/UnitTests.vcxproj @@ -48,7 +48,7 @@ The following libs are needed since we pull in pretty much the entire dolphin codebase. --> - $(ExternalsDir)OpenAL\$(PlatformName);$(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories) + $(ExternalsDir)OpenAL\lib;$(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories) iphlpapi.lib;winmm.lib;setupapi.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib;%(AdditionalDependencies) Console /NODEFAULTLIB:libcmt %(AdditionalOptions) @@ -104,7 +104,7 @@ OutDir :) --> - + From 1a4f044e9e61b48defe8ee9a4f0e1380b3f08442 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 3 Feb 2017 04:51:37 +0100 Subject: [PATCH 3/4] cmake: Add RC file on Windows to DolphinWX --- Source/Core/DolphinWX/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index bc37cc8eaa..989898b399 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -106,6 +106,10 @@ if(APPLE) MACOSX_PACKAGE_LOCATION Resources) endif() +if(WIN32) + list(APPEND SRCS DolphinWX.rc) +endif() + if(APPLE) set(DOLPHIN_EXE_BASE Dolphin) else() From ca42f08e7d7b59827adc387adac64c32d0af9429 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 3 Feb 2017 04:52:22 +0100 Subject: [PATCH 4/4] cmake: Copy resources next to the DolphinWX binary on Windows --- Source/Core/DolphinWX/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/DolphinWX/CMakeLists.txt b/Source/Core/DolphinWX/CMakeLists.txt index 989898b399..9f7501a8ab 100644 --- a/Source/Core/DolphinWX/CMakeLists.txt +++ b/Source/Core/DolphinWX/CMakeLists.txt @@ -188,6 +188,9 @@ if(wxWidgets_FOUND) set_target_properties(${DOLPHIN_EXE} PROPERTIES WIN32_EXECUTABLE ON ) + add_custom_command(TARGET ${DOLPHIN_EXE} + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $/Sys + ) else() install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir}) endif()