Skip to content

Add CMake support - #12

Open
olesgedz wants to merge 3 commits into
mainfrom
feature/cmake
Open

Add CMake support#12
olesgedz wants to merge 3 commits into
mainfrom
feature/cmake

Conversation

@olesgedz

@olesgedz olesgedz commented Aug 20, 2026

Copy link
Copy Markdown

Solves issue

p3d-project/persona-3-dual#344

  • Makefiles are less portable and more complicated

Summary

  • Add CMake support (previously, there was no build support at all) and add GoogleTest as a submodule

Building the project

cmake --preset host-release
cmake --build --preset host-release --parallel

For release build default preset can be used instead:

 cmake --preset default    
 cmake --build --preset default  --parallel

The root build configuration remains lightweight, with CMakeLists.txt acting as the main orchestrator and CMakePresets.json providing configurations for different build targets.

Tests

cmake --preset host-debug

cmake --build --preset build-tests --parallel

ctest --preset test-host

AI Disclaimer

Wasn't used.

Discord

@olesgedz

Testing

CI/CD.

@olesgedz olesgedz self-assigned this Aug 20, 2026
@olesgedz
olesgedz marked this pull request as ready for review August 25, 2026 10:18
@TheBossT910 TheBossT910 added the enhancement New feature or request label Aug 25, 2026

@TheBossT910 TheBossT910 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some issues in your PR description
cmake --build --preset host-release --parallel
Shouldn't the preset be a "buildPresets"? host-release is a "configurePresets"

cmake --build --preset nds-release --parallel
nds-release doesn't exist in "buildPresets"? Looks like a carry over from persona-3-dual repo?

Comment thread tests/CMakeLists.txt Outdated
Comment thread CMakeLists.txt Outdated
Comment thread CMakePresets.json
@TheBossT910 TheBossT910 changed the title cmake Add CMake support Aug 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial CMake-based build/test infrastructure for aegis-engine, including vendored GoogleTest integration and CMake Presets to standardize local/CI workflows.

Changes:

  • Introduces a root CMakeLists.txt that exports aegis_engine as an INTERFACE library with public headers and include paths.
  • Adds a tests/ CMake project that builds/runs GoogleTest-based unit tests.
  • Adds CMakePresets.json plus a GoogleTest submodule entry and ignores out/ build artifacts.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
CMakeLists.txt Defines the core INTERFACE library target and conditionally enables tests via CTest.
CMakePresets.json Provides configure/build/test presets for host debug/release workflows.
tests/CMakeLists.txt Vendors and wires GoogleTest, and defines the test executable + discovery.
tests/entity_test.cpp Adds an initial GoogleTest unit test.
.gitmodules Adds GoogleTest as a submodule dependency.
.gitignore Ignores the out/ build output directory.
Suppressed comments (4)

CMakePresets.json:23

  • The PR description calls out Makefiles as less portable, but this preset forces the Unix Makefiles generator (requires make, and won’t work on many Windows setups). Consider switching to a more portable generator (e.g. Ninja) or omitting generator to use the platform default.
            "displayName": "Aegis Engine Host Release",
            "generator": "Unix Makefiles",
            "binaryDir": "${sourceDir}/out/build/host-release",

CMakePresets.json:27

  • This preset sets AEGIS_BUILD_TESTS, but the project option is AEGIS_ENGINE_BUILD_TESTS (see CMakeLists.txt). As a result, this preset won’t actually control whether tests are added/built.
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Release",
                "AEGIS_BUILD_TESTS": "ON"
            }

CMakePresets.json:37

  • This preset sets AEGIS_BUILD_TESTS, but the project option is AEGIS_ENGINE_BUILD_TESTS (see CMakeLists.txt). As a result, the "no-tests" preset will still configure tests unless BUILD_TESTING is also disabled.
            "cacheVariables": {
                "CMAKE_BUILD_TYPE": "Release",
                "AEGIS_BUILD_TESTS": "OFF"
            }

CMakePresets.json:33

  • The PR description calls out Makefiles as less portable, but this preset forces the Unix Makefiles generator (requires make, and won’t work on many Windows setups). Consider switching to a more portable generator (e.g. Ninja) or omitting generator to use the platform default.
            "displayName": "Aegis Engine Host (Library Only)",
            "generator": "Unix Makefiles",
            "binaryDir": "${sourceDir}/out/build/host-no-tests",

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakePresets.json
Comment on lines +15 to +17
"CMAKE_BUILD_TYPE": "Debug",
"AEGIS_BUILD_TESTS": "ON"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a relevant concern!

Comment thread CMakePresets.json
Comment on lines +11 to +13
"displayName": "Aegis Engine Host Debug",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/out/build/host-debug",

@olesgedz olesgedz Aug 26, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, that one makes sense xD

Comment thread tests/CMakeLists.txt Outdated
Comment thread tests/entity_test.cpp Outdated

@TheBossT910 TheBossT910 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the rename looks good. Copilot caught some issues, and I've also added my comment to Copilot's comments. Take a look at them.

Comment thread tests/CMakeLists.txt Outdated
Comment thread CMakePresets.json
Comment on lines +15 to +17
"CMAKE_BUILD_TYPE": "Debug",
"AEGIS_BUILD_TESTS": "ON"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a relevant concern!

@olesgedz
olesgedz requested a review from TheBossT910 August 27, 2026 09:34

@TheBossT910 TheBossT910 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code LGTM. But the PR description has an incorrect command. cmake --build --preset host-release --parallel. Please fix this.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants