Skip to content

Commit

Permalink
Update build instructions and CI for build subfolder (#808)
Browse files Browse the repository at this point in the history
Update build instructions for compiling from command line or both Windows and Linux
Update CI to build into CI subfolder to match suggested build instructions
Update gitignore in regards to build directory

Co-authored-by: F1F7Y <[email protected]>
  • Loading branch information
GeckoEidechse and F1F7Y authored Sep 3, 2024
1 parent 261fcda commit f9cb7d1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup msvc
uses: ilammy/msvc-dev-cmd@v1
- name: Configure cmake
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="${{ env.BUILD_PROFILE }}"
run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE:STRING="${{ env.BUILD_PROFILE }}"
- name: Setup resource file version
shell: bash
run: |
Expand All @@ -33,7 +33,7 @@ jobs:
FILEVERSION=$(echo ${{ env.NORTHSTAR_VERSION }} | tr '.' ',' | sed -E 's/-rc[0-9]+//' | tr -d '[:alpha:]')
sed -i "s/0,0,0,1/${FILEVERSION}/g" primedev/ns_version.h
- name: Build
run: cmake --build .
run: cmake --build build/
- name: Extract Short Commit Hash
id: extract
shell: bash
Expand All @@ -43,7 +43,7 @@ jobs:
with:
name: NorthstarLauncher-${{ matrix.config.name }}-${{ steps.extract.outputs.commit }}
path: |
game/
build/game/
format-check:
runs-on: ubuntu-latest
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup msvc
uses: ilammy/msvc-dev-cmd@v1
- name: Configure cmake
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Release"
run: cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE:STRING="Release"
- name: Setup resource file version
shell: bash
run: |
Expand All @@ -30,22 +30,22 @@ jobs:
FILEVERSION=$(echo ${{ env.NORTHSTAR_VERSION }} | tr '.' ',' | sed -E 's/-rc[0-9]+//' | tr -d '[:alpha:]')
sed -i "s/0,0,0,1/${FILEVERSION}/g" primedev/ns_version.h
- name: Build
run: cmake --build .
run: cmake --build build/
- name: Upload launcher build as artifact
uses: actions/upload-artifact@v3
with:
name: northstar-launcher
path: |
game/*.exe
game/*.dll
game/bin/x64_retail/*.dll
build/game/*.exe
build/game/*.dll
build/game/bin/x64_retail/*.dll
- name: Upload debug build artifact
uses: actions/upload-artifact@v3
with:
name: launcher-debug-files
path: |
game/*.pdb
game/bin/x64_retail/*.pdb
build/game/*.pdb
build/game/bin/x64_retail/*.pdb
upload-launcher-to-release:
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mono_crash.*

# CMake output
out/
game/
build/game/
build/
CMakeFiles/
cmake_install.cmake
Expand Down
12 changes: 6 additions & 6 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ Developers who can work a command line may be interested in using [Visual Studio

- Follow the same steps as above for Visual Studio Build Tools, but instead of opening in Visual Studio, run the Command Prompt for VS 2022 and navigate to the NorthstarLauncher.

- Run `cmake . -G "Ninja"` to generate build files.
- Run `cmake . -G "Ninja" -B build` to generate build files.

- Run `cmake --build .` to build the project.
- Run `cmake --build build/` to build the project.

## Linux
### Steps
1. Clone the GitHub repo
2. Use `cd` to navigate to the cloned repo's directory
3. Then, run the following commands in order:
* `docker build --rm -t northstar-build-fedora .`
* `docker run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build northstar-build-fedora cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -G "Ninja"`
* `docker run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build northstar-build-fedora cmake --build .`
* `docker run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build northstar-build-fedora cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -G "Ninja" -B build`
* `docker run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build northstar-build-fedora cmake --build build/`

#### Podman

Expand All @@ -57,5 +57,5 @@ When using [`podman`](https://podman.io/) instead of Docker on an SELinux enable
As such the corresponding commands are

* `podman build --rm -t northstar-build-fedora .`
* `podman run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build,z northstar-build-fedora cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -G "Ninja"`
* `podman run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build,z northstar-build-fedora cmake --build .`
* `podman run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build,z northstar-build-fedora cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Windows -G "Ninja" -B build`
* `podman run --rm -it -e CC=cl -e CXX=cl --mount type=bind,source="$(pwd)",destination=/build,z northstar-build-fedora cmake --build build/`

0 comments on commit f9cb7d1

Please sign in to comment.