Skip to content

Commit

Permalink
dev(cmake): make ninja primary build folder
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Dec 2, 2024
1 parent 5d85f92 commit 3785aff
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 31 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cmake-ninja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
run: md www

- name: Copy Binaries (x64)
run: copy build.ninja\Release\*.addon64 www\
run: copy build\Release\*.addon64 www\

- name: Copy Binaries (x32)
run: copy build32.ninja\Release\*.addon32 www\
run: copy build32\Release\*.addon32 www\

- name: Copy Binaries (Tools)
run: copy build.ninja\Release\*.exe www\
run: copy build\Release\*.exe www\

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@
*.app

build/**
build.ninja/**
build32/**
build.ninja/**
build32.ninja/**
build.vs/**
build32.vs/**


**/.vshistory/
.cache/**
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17.2)
cmake_minimum_required(VERSION 3.27)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down
44 changes: 22 additions & 22 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"binaryDir": "build.ninja"
"binaryDir": "build"
},
{
"name": "ninja-x32",
"inherits": "ninja-x64",
"displayName": "Ninja x32",
"binaryDir": "build32.ninja"
"binaryDir": "build32"
},
{
"name": "vs-x64",
"displayName": "Visual Studio x64",
"description": "Generates Visual Studio solution and project files. Slower build than ninja.",
"inherits": "x64",
"generator": "Visual Studio 17 2022",
"binaryDir": "build",
"binaryDir": "build.vs",
"cacheVariables": {
"CMAKE_SYSTEM_VERSION": "10.0.26100.0"
}
Expand All @@ -76,7 +76,7 @@
"name": "vs-x32",
"inherits": "vs-x64",
"displayName": "Visual Studio x32",
"binaryDir": "build32"
"binaryDir": "build32.vs"
}
],
"buildPresets": [
Expand All @@ -98,24 +98,6 @@
"configurePreset": "ninja-x64",
"configuration": "RelWithDebInfo"
},
{
"name": "vs-x64-debug",
"displayName": "Visual Studio x64 Debug",
"configurePreset": "vs-x64",
"configuration": "Debug"
},
{
"name": "vs-x64-release",
"displayName": "Visual Studio x64 Release",
"configurePreset": "vs-x64",
"configuration": "Release"
},
{
"name": "vs-x64-RelWithDebInfo",
"displayName": "Visual Studio x64 RelWithDebInfo",
"configurePreset": "vs-x64",
"configuration": "RelWithDebInfo"
},
{
"name": "ninja-x32-debug",
"displayName": "Ninja x32 Debug",
Expand All @@ -134,6 +116,24 @@
"configurePreset": "ninja-x32",
"configuration": "RelWithDebInfo"
},
{
"name": "vs-x64-debug",
"displayName": "Visual Studio x64 Debug",
"configurePreset": "vs-x64",
"configuration": "Debug"
},
{
"name": "vs-x64-release",
"displayName": "Visual Studio x64 Release",
"configurePreset": "vs-x64",
"configuration": "Release"
},
{
"name": "vs-x64-RelWithDebInfo",
"displayName": "Visual Studio x64 RelWithDebInfo",
"configurePreset": "vs-x64",
"configuration": "RelWithDebInfo"
},
{
"name": "vs-x32-debug",
"displayName": "Visual Studio x32 Debug",
Expand Down
15 changes: 11 additions & 4 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,25 @@ Update the submodules

Configure the project

* `cmake --preset vs-x64`
* `cmake --preset ninja-x64`

Build the project

* `cmake --build --preset vs-x64-release`
* `cmake --build --preset ninja-x64-release`

----------------

*Note: for 32bit binaries use:*

* `cmake --preset vs-x32`
* `cmake --build --preset vs-x32-release`
* `cmake --preset ninja-x32`
* `cmake --build --preset ninja-x32-release`

----------------

*Note: for Visual Studio use:*

* `cmake --preset vs-x64`
* `cmake --build --preset vs-x64-release`


### Automated configuration
Expand Down

0 comments on commit 3785aff

Please sign in to comment.