Skip to content

Commit

Permalink
known broken: Integrate vcpkg to the .vcxproj.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotonen committed Dec 9, 2023
1 parent fa87e18 commit b2db1cb
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 2,441 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/push-unit-tests-static-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Unit Tests / Required / Static / Windows

on:
pull_request:
merge_group:

env:
VCPKG_DISABLE_METRICS: 1

jobs:
build:
name: 'Server 2022'
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build-type:
- Release
- Debug
steps:
- name: Checkout Anura
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# We need the full history for the vcpkg integration to work
fetch-depth: 0
submodules: true

# Sets a cache up for vcpkg
- name: Install vcpkg
uses: lukka/run-vcpkg@abed23940f9d7bc267b0e1a21ee7b699a3794baa # v11.1

- name: Install MSBuild
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
with:
msbuild-architecture: x64
# Visual Studio 2022
vs-version: '17'

# This also runs vcpkg as we have everything defined in the .vcxproj
- name: Build Anura
run: msbuild -m -p:Configuration="${{ matrix.build-type }}" windows/anura.sln

- name: Run Unit Tests
run: .\windows\x64\"${{ matrix.build-type }}"\anura.exe --tests
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,24 @@ way of the land.

#### Windows

Undocumented as of 2023-08.
The build is known broken as of 2023-08. It has been manually edited on Linux
and it's spitting errors out when opened with a Visual Studio proper. It mostly
builds fine with msbuild on the command line.

Known problems 2023-08:

* Visual Studio does not like the current solution and project files

The .sln and .vcxproj are intending for the following set of constraints:

* Wrap vcpkg
* Install correct dependencies
* Debug
* Release
* Default set of warnings
* Don't treat warnings as errors
* "Press play to run"
* "Press play to debug"

#### macOS

Expand Down Expand Up @@ -275,8 +292,10 @@ On every push:
* NOT IMPLEMENTED [JSON
Formatter](https://github.com/callumlocke/json-formatter)
* Unit Tests
* NOT IMPLEMENTED Windows / msbuild / Release / static
* NOT IMPLEMENTED Windows / msbuild / Debug / static
* KNOWN BROKEN [Windows / msbuild / Release /
static](https://github.com/anura-engine/anura/blob/trunk/.github/workflows/push-unit-tests-static-windows.yaml)
* KNOWN BROKEN [Windows / msbuild / Debug /
static](https://github.com/anura-engine/anura/blob/trunk/.github/workflows/push-unit-tests-static-windows.yaml)
* NOT IMPLEMENTED macOS / xcodebuild / Release / static
* NOT IMPLEMENTED macOS / xcodebuild / Debug / static
* Ubuntu 22.04 / clang++ / Release / dynamic
Expand Down
15 changes: 9 additions & 6 deletions windows/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Building on Windows

In order build Anura, you will need Visual Studio 2022 and [vcpkg](https://github.com/microsoft/vcpkg) installed.
In order build Anura, you will need [Visual
Studio](https://visualstudio.microsoft.com/downloads/) 2022.

If you do not have vcpkg set up:
- Clone the [vcpkg repo](https://github.com/microsoft/vcpkg) somewhere outside the anura folder.
- Inside the vcpkg folder, run `bootstrap-vcpkg.bat`, then `vcpkg integrate install`.
The solution and project wrap vcpkg for you and you should be simply able to
"press play".

Once vcpkg is integrated with Visual Studio:
- Open `anura.sln` and build. The executable will be in `./$(Target)-$(Configuration)/` (`./x64-Release`, for example).
An alternate route is to only grab the [build
tools](https://visualstudio.microsoft.com/downloads/?q=build+tools#build-tools-for-visual-studio-2022)
and to build on the command line with `msbuild`. See the
[CI](https://github.com/anura-engine/anura/blob/trunk/.github/workflows/push-unit-tests-static-windows.yaml)
definition for the current details.
6 changes: 3 additions & 3 deletions windows/anura.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release|Win32 = Release|Win32
Release|Win64 = Release|Win64
Debug|Win64 = Debug|Win64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{716CE053-6375-400F-BEB5-0AC23E709C55}.Release|Win32.ActiveCfg = Release|Win32
{716CE053-6375-400F-BEB5-0AC23E709C55}.Release|Win32.Build.0 = Release|Win32
{716CE053-6375-400F-BEB5-0AC23E709C55}.Release|Win64.ActiveCfg = Release|x64
{716CE053-6375-400F-BEB5-0AC23E709C55}.Release|Win64.Build.0 = Release|x64
{716CE053-6375-400F-BEB5-0AC23E709C55}.Debug|Win64.ActiveCfg = Debug|x64
{716CE053-6375-400F-BEB5-0AC23E709C55}.Debug|Win64.Build.0 = Debug|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit b2db1cb

Please sign in to comment.