Skip to content

CMake Options

Dimo Markov edited this page Jul 3, 2024 · 12 revisions

The following CMake options will be available for you, if you've added (or opened) Langulus::Core or any other Langulus library. They are color coded, green being 100% supported and tested. Some options affect multiple libraries that inherit Langulus::Core.

  • LANGULUS_SHARED_LIBRARIES - Will build shared Langulus libraries (DLL/SO) if enabled. True by default. This wouldn't affect anything else, except Langulus targets.
  • LANGULUS_SAFE_MODE - Adds additional error and sanity checks, but incurs a serious runtime overhead. Disabled by default in release builds.
  • LANGULUS_PRECISION - Decides what the default floating number format would be (WIP). Currently only float is tested and the option doesn't really do anything.
  • LANGULUS_PARANOIA - Makes sure that any unused memory is nullified when freed, and that allocated memory addresses are not predictable. Incurs a serious runtime overhead. Mangles logging of sensitive info, like memory addresses or paths (will use hashes instead). Disabled by default.
  • LANGULUS_TESTING - Builds tests. Disabled by default, because Langulus tests are very exhaustive and will increase your build time and RAM usage considerably. Will download and link automatically with Catch2.
    • LANGULUS_BENCHMARK - Enable benchmarking in tests, as well as performance regression tests. Disabled by default. It will increase testing time significantly. Requires LANGULUS_TESTING to be enabled, too.
  • LANGULUS_DEBUGGING - Explicitly define debug mode, in the case that default flags are not detected automatically by some odd reason. Disabled by default for release builds.
  • LANGULUS_FEATURE_MANAGED_MEMORY - Memory will be pooled and recycled when freed, and you can safely push any kind of pointer, as long as it was allocated by the memory manager or by the overridden new/delete feature. Enabled by default, which will force some Langulus libraries to download and link with Langulus::Fractalloc.
    • ⚠️LANGULUS_FEATURE_NEWDELETE - Overrides new/delete operators for anything statically linked to this library, or provides LANGULUS_MONOPOLIZE_MEMORY() macro for you to use to override them if dynamically linked. This feature can be enabled only if LANGULUS_FEATURE_MANAGED_MEMORY is enabled. Disabled by default. Not extensively tested. See Langulus::Fractalloc.
    • LANGULUS_FEATURE_MANAGED_REFLECTION - Reflections will be kept in a centralized location when reflected, which speeds up type comparisons and allows you to dynamically modify the reflection at runtime. This feature can be enabled only if LANGULUS_FEATURE_MANAGED_MEMORY is enabled. Enabled by default. Changes the behavior of the Langulus::RTTI library.
      • LANGULUS_FEATURE_MEMORY_STATISTICS - Memory manager shall keep track of statistics for the price of little overhead. Gives the memory manager the ability to dynamically adapt to usage, if LANGULUS_FEATURE_MANAGED_REFLECTION is enabled. Disabled by default on release builds.
  • LANGULUS_ALIGNMENT - Global pointer alignment, 16 bytes by default. It directly controls what kinds of SIMD optimizations are allowed, and what the minimal allocation size is.
  • LANGULUS_FEATURE_UNICODE - Provides UTF8, UTF16, UTF32 tools and conversions for all Langulus text containers (WIP). This option will affect only Langulus::Anyness library.
  • LANGULUS_FEATURE_COMPRESSION - Provides memory compression for use with Langulus containers (WIP). This option will affect only Langulus::Anyness library.
  • LANGULUS_FEATURE_ENCRYPTION - Allows for memory encryption for use with Langulus containers (WIP). This option will affect only Langulus::Anyness library.

Some additional but less relevant Langulus::Logger configuration options:

  • LANGULUS_LOGGER_ENABLE_FATALERRORS - Enables fatal error logging via Logger::Fatal(...). Enabled by default.
  • LANGULUS_LOGGER_ENABLE_ERRORS - Enables error logging via Logger::Error(...). Enabled by default.
  • LANGULUS_LOGGER_ENABLE_WARNINGS - Enables warning logging via Logger::Warning(...). Enabled by default.
  • LANGULUS_LOGGER_ENABLE_INFOS - Enables information logging via Logger::Info(...). Enabled by default.
  • LANGULUS_LOGGER_ENABLE_MESSAGES - Enables user notifications via Logger::Message(...)". Enabled by default.
  • LANGULUS_LOGGER_ENABLE_PROMPTS - Enables user input prompts via Logger::Prompt(...), as well as the possibility for (blocking) console input, or modal dialogs that require user input. Not implemented yet.
  • LANGULUS_LOGGER_ENABLE_VERBOSE - Enables verbose logging via Logger::Verbose(...). Enabled by default only for debug builds.
  • LANGULUS_LOGGER_ENABLE_SPECIALS - Enables special message (a.k.a. just purple and more visible verbose messages) logging via Logger::Special(...). Enabled by default only for debug builds.
  • LANGULUS_LOGGER_ENABLE_FLOWS - Enables flow logging (messages associated with executing scripts) via Logger::Flow(...). Enabled by default only for debug builds. Extensively used by Langulus::Flow.
  • LANGULUS_LOGGER_ENABLE_INPUTS - Enables input event logging via Logger::Input(...). Enabled by default only for debug builds.
  • LANGULUS_LOGGER_ENABLE_NETWORKS - Enables network logging via Logger::Network(...). Enabled by default only for debug builds.
  • LANGULUS_LOGGER_ENABLE_OS - Enables OS event logging via Logger::OS(...). Enabled by default only for debug builds.
Clone this wiki locally