diff --git a/Makefile b/Makefile index b1f6927ee..43c163b61 100755 --- a/Makefile +++ b/Makefile @@ -52,6 +52,11 @@ mk_cmake: -DCMAKE_INSTALL_PREFIX=$(MK_INSTALL_PATH) \ -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_UNIX_PATH) \ -DKOMPUTE_EXTRA_CXX_FLAGS=$(MK_KOMPUTE_EXTRA_CXX_FLAGS) \ + -DKOMPUTE_OPT_BUILD_TESTS=1 \ + -DKOMPUTE_OPT_BUILD_DOCS=1 \ + -DKOMPUTE_OPT_BUILD_SHADERS=1 \ + -DKOMPUTE_OPT_BUILD_SINGLE_HEADER=1 \ + -DKOMPUTE_OPT_ENABLE_SPDLOG=1 \ $(MK_CMAKE_EXTRA_FLAGS) \ -G "Unix Makefiles" @@ -89,6 +94,11 @@ vs_cmake: $(VS_CMAKE_EXTRA_FLAGS) \ -DKOMPUTE_EXTRA_CXX_FLAGS=$(VS_KOMPUTE_EXTRA_CXX_FLAGS) \ -DCMAKE_INSTALL_PREFIX=$(VS_INSTALL_PATH) \ + -DKOMPUTE_OPT_BUILD_TESTS=1 \ + -DKOMPUTE_OPT_BUILD_DOCS=1 \ + -DKOMPUTE_OPT_BUILD_SHADERS=1 \ + -DKOMPUTE_OPT_BUILD_SINGLE_HEADER=1 \ + -DKOMPUTE_OPT_ENABLE_SPDLOG=1 \ -G "Visual Studio 16 2019" vs_build_all: diff --git a/README.md b/README.md index eb438a473..6ad1b4489 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,37 @@ Simplified Kompute Components ## Build Overview +The build system provided is CMAKE which allows for cross platform builds. Below is a brief overview of the build system. + +### CMAKE parameters + +The recommended approach to build the project is as out-of-source build in the `build` folder. This project comes with a `Makefile` that provides a set of commands that help with developer workflows. You can see some of the commands if you want to add some of the more advanced commands. + +For a base build you just have to run: +``` +cmake -Bbuild +``` + +This by default configures without any of the extra build tasks (such as building shaders) and compiles without the optional dependencies. The table below provides more detail. + +|-------------------------------------|--------------------------------------------------------------------------| +| -DKOMPUTE_ENABLE_SPDLOG=1 | Enables the build with SPDLOG and FMT dependencies (must be installed) | +|-------------------------------------|--------------------------------------------------------------------------| +| -DCMAKE_INSTALL_PREFIX=\ | Enables local installation (which won't require admin privileges) | +| "build/src/CMakefiles/Export/" | This can be used for the standalone samples in the examples folder | +|-------------------------------------|--------------------------------------------------------------------------| +| -DCMAKE_TOOLCHAIN_FILE="..." | This is the path for your package manager if you use it such as vcpkg | +|-------------------------------------|--------------------------------------------------------------------------| +| -DKOMPUTE_OPT_BUILD_TESTS=1 | Enable if you wish to build and run the tests (must have deps installed. | +|-------------------------------------|--------------------------------------------------------------------------| +| -DKOMPUTE_OPT_BUILD_DOCS=1 | Enable if you wish to build the docs (must have docs deps installed) | +|-------------------------------------|--------------------------------------------------------------------------| +| -DKOMPUTE_OPT_BUILD_SINGLE_HEADER=1 | Option to build the single header file using "quom" utility | +|-------------------------------------|--------------------------------------------------------------------------| +| -DKOMPUTE_EXTRA_CXX_FLAGS="..." | Allows you to pass extra config flags to compiler | +|-------------------------------------|--------------------------------------------------------------------------| + + ### Dependencies Given Kompute is expected to be used across a broad range of architectures and hardware, it will be important to make sure we are able to minimise dependencies.