Quick Start Guide#
hyperion::platform supports both CMake and XMake, and incorporating it in your project is quick and easy.
CMake#
hyperion::platform is easily incorporated into a raw CMake project with FetchContent or
other methods like add_subdirectory. Example for FetchContent:
 1# Include FetchContent so we can use it
 2include(FetchContent)
 3
 4# Declare the dependency on hyperion-utils and make it available for use
 5FetchContent_Declare(hyperion_platform
 6    GIT_REPOSITORY "https://github.com/braxtons12/hyperion_platform"
 7    GIT_TAG "v0.5.0")
 8FetchContent_MakeAvailable(hyperion_platform)
 9
10# For this example, we create an executable target and link hyperion::platform to it
11add_executable(MyExecutable "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")
12target_link_libraries(MyExecutable PRIVATE hyperion::platform)
hyperion::platform depends on fast_float for parsing of literals of the
f32 and f64 floating point type aliases.
Note that hyperion::platform has an optional feature, for the profiling macros it wraps in
#include <hyperion/platform/def.h>. When this feature is enabled, it requires the
optional dependency, Tracy.
By default, this is disabled. You can enable it by setting HYPERION_ENABLE_TRACY to
ON.
If enabled, by default FetchContent will be used to obtain this optional dependency,
but you can disable this by setting HYPERION_USE_FETCH_CONTENT to OFF,
in which case you will need to make sure the package is findable via CMake’s find_package.
XMake#
XMake is a new(er) Lua-based build system with integrated package management. It is the preferred way to use Hyperion packages. Example:
 1set_project("my_project")
 2
 3-- add the hyperion_packages git repository as an XMake repository
 4add_repositories("hyperion https://github.com/braxtons12/hyperion_packages.git")
 5
 6-- add hyperion_platform as a required dependency for the project
 7add_requires("hyperion_platform", {
 8    system = false,
 9    external = true,
10})
11
12-- For this example, we create an executable target and link hyperion::platform to it
13target("my_executable")
14    set_kind("binary")
15    add_packages("hyperion_platform")
Note that with XMake, hyperion::platform has the same optional features and dependencies as with the CMake build system. Third-party dependencies will be pulled from xmake-repo, the package repository/registry for XMake.
As with CMake, you can enable or disable the Tracy profiling macros (defaults to off) by setting the
option hyperion_enable_tracy.