Skip to content

Commit

Permalink
build: get Visual Studio 2019 to compile
Browse files Browse the repository at this point in the history
Adds basic instructions to README.md

Updates SDL2 NuGet package.

Updates .gitignore to exclude all generated build objects and the
downloaded NuGet packages (VS downloads them automatically if missing,
seems better than storing old versions here).

Removes files from legacy VS versions.

The resulting build isn't usable for playing (see README.md).
Maybe someone who uses this platform can fix it.

Closes #129

Signed-off-by: bones_was_here <[email protected]>
  • Loading branch information
bones-was-here committed Apr 11, 2024
1 parent c03b106 commit 4c8d375
Show file tree
Hide file tree
Showing 110 changed files with 45 additions and 48,326 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ obj/
*.o
*.i
*.s

# MSVC build objects
Debug-darkplaces-sdl2-vs*/
Release-darkplaces-sdl2-vs*/
*.obj
*.tlog
# MSVC NuGet packages, VS downloads them automatically.
# Other platforms also provide SDL2 headers rather than storing old ones here.
packages/

ChangeLog
darkplaces-agl
darkplaces-glx
Expand Down
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Runtime (optional): `libcurl` `libpng` `libfreetype6` `libvorbisfile`
Build (mandatory): `build-essential` `libjpeg-dev` `zlib1g-dev`
Runtime (optional): `libcurl` `libpng`

### Windows (MSYS2):
### Windows (MSYS2 MinGW):

1. Install MSYS2, found [here](https://www.msys2.org/).
2. Once you've installed MSYS2 and have fully updated it, open a MinGW64 terminal (***not an MSYS2 terminal***) and input the following command:
Expand Down Expand Up @@ -92,10 +92,24 @@ To build the main executable, input `make sdl-release` which creates the file ca
If you get errors (that don't seem to be about missing dependencies) try `make clean` before compiling, especially if you updated your system since the last time you compiled.


### Windows (Visual Studio)
### Windows (Visual Studio 2019)

Not recommended due to poor support for C standards, and lack of maintenance.

DarkPlaces requires C11, so Windows SDK 10.0.22000.0 (VS 2019) or 10.0.20348.0 (VS 2022) or later is needed.
To install it, run the Visual Studio Installer, click "Modify", click "Individual components", select the latest Windows SDK version and de-select older versions.
You will also need the NuGet Package Manager selected (to download SDL2 headers the first time you build).
Click "Modify" to apply the changes.

VS 2019
![MSVC2019](msvc2019_C11.png)

Open `darkplaces-vs2019.sln`, select build type "Debug" or "Release, and choose "Build Solution" from the "Build" menu to create the file `darkplaces-sdl2-vs2019.exe`.

The Release build crashes. The Debug build doesn't crash (but is rather slow) so this will be Fun for someone to debug.

To get a build suitable for playing Quake you'll need to use MinGW gcc, or download the autobuild from Xonotic (see above).

May work but not recommended due to lack of support for C standards, and lack of maintenance.
Instructions TODO.

## Contributing

Expand Down
439 changes: 0 additions & 439 deletions darkplaces-sdl2-vs2017.vcxproj

This file was deleted.

35 changes: 12 additions & 23 deletions darkplaces-sdl2-vs2019.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<RootNamespace>darkplacessdl2</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>darkplaces-sdl2-vs2019</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
Expand Down Expand Up @@ -51,22 +51,6 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="vs2012_sdl2_win32.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="vs2012_sdl2_win32.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="vs2012_sdl2_win64.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="vs2012_sdl2_win64.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>11.0.50727.1</_ProjectFileVersion>
Expand Down Expand Up @@ -122,7 +106,6 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CONFIG_MENU;CONFIG_VIDEO_CAPTURE;WIN32;WIN64;_DEBUG;_WINDOWS;_FILE_OFFSET_BITS=64;__KERNEL_STRICT_NAMES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
Expand All @@ -131,6 +114,8 @@
<DisableSpecificWarnings>4706;4127;4100;4055;4054;4244;4305;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/wd"4201" %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
Expand Down Expand Up @@ -182,6 +167,8 @@
<DisableSpecificWarnings>4706;4127;4100;4055;4054;4244;4305;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/wd"4201" %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
Expand Down Expand Up @@ -266,6 +253,7 @@
<ClCompile Include="model_sprite.c" />
<ClCompile Include="mvm_cmds.c" />
<ClCompile Include="netconn.c" />
<ClCompile Include="phys.c" />
<ClCompile Include="palette.c" />
<ClCompile Include="polygon.c" />
<ClCompile Include="portals.c" />
Expand Down Expand Up @@ -385,6 +373,7 @@
<ClInclude Include="modelgen.h" />
<ClInclude Include="mprogdefs.h" />
<ClInclude Include="netconn.h" />
<ClInclude Include="phys.h" />
<ClInclude Include="palette.h" />
<ClInclude Include="pmove.h" />
<ClInclude Include="polygon.h" />
Expand All @@ -411,7 +400,7 @@
<ClInclude Include="resource.h" />
<ClInclude Include="sbar.h" />
<ClInclude Include="screen.h" />
<ClInclude Include="SDLMain.h" />
<ClInclude Include="SDL.h" />
<ClInclude Include="server.h" />
<ClInclude Include="shader_glsl.h" />
<ClInclude Include="snd_main.h" />
Expand Down Expand Up @@ -442,14 +431,14 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="packages\sdl2.nuget.redist.2.0.22\build\native\sdl2.nuget.redist.targets" Condition="Exists('packages\sdl2.nuget.redist.2.0.22\build\native\sdl2.nuget.redist.targets')" />
<Import Project="packages\sdl2.nuget.2.0.22\build\native\sdl2.nuget.targets" Condition="Exists('packages\sdl2.nuget.2.0.22\build\native\sdl2.nuget.targets')" />
<Import Project="packages\sdl2.nuget.redist.2.30.2\build\native\sdl2.nuget.redist.targets" Condition="Exists('packages\sdl2.nuget.redist.2.30.2\build\native\sdl2.nuget.redist.targets')" />
<Import Project="packages\sdl2.nuget.2.30.2\build\native\sdl2.nuget.targets" Condition="Exists('packages\sdl2.nuget.2.30.2\build\native\sdl2.nuget.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\sdl2.nuget.redist.2.0.22\build\native\sdl2.nuget.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.redist.2.0.22\build\native\sdl2.nuget.redist.targets'))" />
<Error Condition="!Exists('packages\sdl2.nuget.2.0.22\build\native\sdl2.nuget.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.2.0.22\build\native\sdl2.nuget.targets'))" />
<Error Condition="!Exists('packages\sdl2.nuget.redist.2.30.2\build\native\sdl2.nuget.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.redist.2.30.2\build\native\sdl2.nuget.redist.targets'))" />
<Error Condition="!Exists('packages\sdl2.nuget.2.30.2\build\native\sdl2.nuget.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\sdl2.nuget.2.30.2\build\native\sdl2.nuget.targets'))" />
</Target>
</Project>
44 changes: 0 additions & 44 deletions darkplaces-vs2017.sln

This file was deleted.

Binary file added docs/msvc2019_C11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="sdl2.nuget" version="2.0.22" targetFramework="native" />
<package id="sdl2.nuget.redist" version="2.0.22" targetFramework="native" />
<package id="sdl2.nuget" version="2.30.2" targetFramework="native" />
<package id="sdl2.nuget.redist" version="2.30.2" targetFramework="native" />
</packages>
Binary file removed packages/sdl2.nuget.2.0.22/.signature.p7s
Binary file not shown.
11 changes: 0 additions & 11 deletions packages/sdl2.nuget.2.0.22/build/configurations.autopkg

This file was deleted.

21 changes: 0 additions & 21 deletions packages/sdl2.nuget.2.0.22/build/native/default-propertiesui.xml

This file was deleted.

Loading

0 comments on commit 4c8d375

Please sign in to comment.