Merge pull request #4809 from Orphis/cmake_windows
CMake for Windows: getting a working binary!
This commit is contained in:
commit
a3ba169e7d
|
@ -199,6 +199,11 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||||
check_and_add_flag(EXCEPTIONS /EHsc)
|
check_and_add_flag(EXCEPTIONS /EHsc)
|
||||||
dolphin_compile_definitions(-D_DEBUG DEBUG_ONLY)
|
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
|
# Only MSBuild needs this, other generators will compile one file at a time
|
||||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
add_compile_options("/MP")
|
add_compile_options("/MP")
|
||||||
|
@ -482,6 +487,9 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_OPENAL)
|
if(ENABLE_OPENAL)
|
||||||
|
if(WIN32)
|
||||||
|
set(ENV{OPENALDIR} ${CMAKE_CURRENT_LIST_DIR}/Externals/OpenAL)
|
||||||
|
endif()
|
||||||
find_package(OpenAL)
|
find_package(OpenAL)
|
||||||
if(OPENAL_FOUND)
|
if(OPENAL_FOUND)
|
||||||
add_definitions(-DHAVE_OPENAL=1)
|
add_definitions(-DHAVE_OPENAL=1)
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<BaseAddress>0x00400000</BaseAddress>
|
<BaseAddress>0x00400000</BaseAddress>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
<FixedBaseAddress>true</FixedBaseAddress>
|
<FixedBaseAddress>true</FixedBaseAddress>
|
||||||
<AdditionalLibraryDirectories>$(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>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)</AdditionalDependencies>
|
<AdditionalDependencies>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)</AdditionalDependencies>
|
||||||
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Windows</SubSystem>
|
<SubSystem Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Windows</SubSystem>
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/NODEFAULTLIB:libcmt</AdditionalOptions>
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/NODEFAULTLIB:libcmt</AdditionalOptions>
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
|
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
|
||||||
<DataTxtFiles Include="$(DolphinRootDir)Data\*.txt" />
|
<DataTxtFiles Include="$(DolphinRootDir)Data\*.txt" />
|
||||||
<ExternalDlls Include="$(ExternalsDir)OpenAL\$(PlatformName)\*.dll" />
|
<ExternalDlls Include="$(ExternalsDir)OpenAL\lib\*.dll" />
|
||||||
<BinaryFiles Include="$(TargetPath)" />
|
<BinaryFiles Include="$(TargetPath)" />
|
||||||
<AllInputFiles Include="@(DataSysFiles);@(DataTxtFiles);@(ExternalDlls);@(BinaryFiles)" />
|
<AllInputFiles Include="@(DataSysFiles);@(DataTxtFiles);@(ExternalDlls);@(BinaryFiles)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -106,6 +106,10 @@ if(APPLE)
|
||||||
MACOSX_PACKAGE_LOCATION Resources)
|
MACOSX_PACKAGE_LOCATION Resources)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND SRCS DolphinWX.rc)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(DOLPHIN_EXE_BASE Dolphin)
|
set(DOLPHIN_EXE_BASE Dolphin)
|
||||||
else()
|
else()
|
||||||
|
@ -184,6 +188,9 @@ if(wxWidgets_FOUND)
|
||||||
set_target_properties(${DOLPHIN_EXE} PROPERTIES
|
set_target_properties(${DOLPHIN_EXE} PROPERTIES
|
||||||
WIN32_EXECUTABLE ON
|
WIN32_EXECUTABLE ON
|
||||||
)
|
)
|
||||||
|
add_custom_command(TARGET ${DOLPHIN_EXE}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Data/Sys $<TARGET_FILE_DIR:${DOLPHIN_EXE}>/Sys
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir})
|
install(TARGETS ${DOLPHIN_EXE} RUNTIME DESTINATION ${bindir})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
<BaseAddress>0x00400000</BaseAddress>
|
<BaseAddress>0x00400000</BaseAddress>
|
||||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||||
<FixedBaseAddress>true</FixedBaseAddress>
|
<FixedBaseAddress>true</FixedBaseAddress>
|
||||||
<AdditionalLibraryDirectories>$(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(ExternalsDir)ffmpeg\lib;$(ExternalsDir)OpenAL\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>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)</AdditionalDependencies>
|
<AdditionalDependencies>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)</AdditionalDependencies>
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
@ -291,7 +291,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
|
<DataSysFiles Include="$(DolphinRootDir)Data\**\Sys\**\*.*" />
|
||||||
<DataTxtFiles Include="$(DolphinRootDir)Data\license.txt" />
|
<DataTxtFiles Include="$(DolphinRootDir)Data\license.txt" />
|
||||||
<ExternalDlls Include="$(ExternalsDir)OpenAL\$(PlatformName)\*.dll" />
|
<ExternalDlls Include="$(ExternalsDir)OpenAL\lib\*.dll" />
|
||||||
<BinaryFiles Include="$(TargetPath)" />
|
<BinaryFiles Include="$(TargetPath)" />
|
||||||
<AllInputFiles Include="@(DataSysFiles);@(DataTxtFiles);@(ExternalDlls);@(BinaryFiles)" />
|
<AllInputFiles Include="@(DataSysFiles);@(DataTxtFiles);@(ExternalDlls);@(BinaryFiles)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
The following libs are needed since we pull in pretty much the entire
|
The following libs are needed since we pull in pretty much the entire
|
||||||
dolphin codebase.
|
dolphin codebase.
|
||||||
-->
|
-->
|
||||||
<AdditionalLibraryDirectories>$(ExternalsDir)OpenAL\$(PlatformName);$(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(ExternalsDir)OpenAL\lib;$(ExternalsDir)ffmpeg\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>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)</AdditionalDependencies>
|
<AdditionalDependencies>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)</AdditionalDependencies>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/NODEFAULTLIB:libcmt %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
OutDir :)
|
OutDir :)
|
||||||
-->
|
-->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ExternalDlls Include="$(ExternalsDir)OpenAL\$(PlatformName)\*.dll" />
|
<ExternalDlls Include="$(ExternalsDir)OpenAL\lib\*.dll" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--Either method of running requires the runtime deps to be copied to pwd-->
|
<!--Either method of running requires the runtime deps to be copied to pwd-->
|
||||||
<Target Name="CopyDeps" AfterTargets="AfterBuild" Inputs="@(ExternalDlls)" Outputs="@(ExternalDlls -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')">
|
<Target Name="CopyDeps" AfterTargets="AfterBuild" Inputs="@(ExternalDlls)" Outputs="@(ExternalDlls -> '$(OutDir)%(RecursiveDir)%(Filename)%(Extension)')">
|
||||||
|
|
Loading…
Reference in New Issue