demotool/c-buildcfg.hh

68 lines
1.8 KiB
C++
Raw Permalink Normal View History

2017-12-02 18:38:34 +01:00
#pragma once
#ifndef REAL_BUILD
# include "externals.hh"
#endif
/*= BUILD CONFIGURATIONS =====================================================*/
// Build configuration
struct T_BuildConfiguration
{
// Targets -------------------------------------------------------------
// Resolutions
bool resolutionChooser{ true };
T_Array< std::pair< uint32_t , uint32_t > > resolutions;
// Enable optimizer?
bool optimize{ false };
// Constant folding ----------------------------------------------------
// Main toggle
bool constantFolding{ false };
// Optimize $width and $height away if the size is fixed
bool cfFixedSize{ false };
// Get rid of (get-input) for constant or undefined curves
bool cfInputs{ false };
// Constant propagation ------------------------------------------------
bool constantPropagation{ false };
2017-12-02 18:38:34 +01:00
// Dead code elimination -----------------------------------------------
bool deadCodeElimination{ false };
// Function inlining ---------------------------------------------------
bool inlineFunctions{ false };
2017-12-02 18:38:34 +01:00
};
// Table of avaiable build configurations
using T_BuildConfigurations = T_KeyValueTable< T_String , T_BuildConfiguration >;
// Build configurations loader
struct T_BuildConfigurationLoader : public ebcl::A_PrivateImplementation
{
T_BuildConfigurationLoader( ) noexcept;
// Load build configurations from the specified path; may throw
// X_StreamError or X_SRDErrors
2017-12-28 10:27:23 +01:00
T_BuildConfigurations load( );
2017-12-02 18:38:34 +01:00
};
/*----------------------------------------------------------------------------*/
// Logger
using F_OPGenLog = std::function< T_StringBuilder( ) >;
using F_OPLogger = std::function< void( F_OPGenLog , uint32_t ) >;
// Runtime configuration (logger, etc.)
struct T_BuildRuntimeConfiguration
{
F_OPLogger logger{ [](auto,auto){} };
};