Skip to content

Add CMake build support#5

Draft
MolassesLover wants to merge 3 commits into
nelo-dev:masterfrom
MolassesLover:add-cmake
Draft

Add CMake build support#5
MolassesLover wants to merge 3 commits into
nelo-dev:masterfrom
MolassesLover:add-cmake

Conversation

@MolassesLover

@MolassesLover MolassesLover commented Dec 28, 2024

Copy link
Copy Markdown
Contributor

This pull request intends to add CMake build support as discussed in issue #4.

Building can be done with the following commands:

cmake \
    -B target/release \
    -D CMAKE_BUILD_TYPE=Release \
    -D BUILD_EXAMPLES=ON 
cmake --build target/release -j$(nproc)

This currently does not compile shaders, however, and they must compiled manually. Test binaries will be located in target/release/run/, following the given command.

To-do

  • Fix run/resources copying into ${CMAKE_CURRENT_BINARY_DIR}/resources/resources
  • Create a build task to compile shaders.
  • Allow system-level stb and VulkanMemoryAllocator libraries to be used.
  • Create a Makefile to abstract away CMake commands.
  • Rewrite build documentation.

Wrote CMake build files with library configuration options. Files still
unfinished as of this commit, but allow the library to be compiled.
Example binaries can also be compiled, but do not build shader files.
This commit adds a custom build target to build script responsible for
building the examples. The script will now iterate through shaders
declared in the `${SHADER_FILES}` variable, use a RegEx pattern to check
whether they're a vertex or fragment shader, and then compile them to
the right path.
@MolassesLover

MolassesLover commented Dec 29, 2024

Copy link
Copy Markdown
Contributor Author

Added a build target for the shaders, so they should compile on build time.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant