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 };
|
|
|
|
|
2017-12-03 14:59:39 +01:00
|
|
|
// Constant propagation ------------------------------------------------
|
|
|
|
|
|
|
|
bool constantPropagation{ false };
|
|
|
|
|
2017-12-02 18:38:34 +01:00
|
|
|
// Dead code elimination -----------------------------------------------
|
|
|
|
|
|
|
|
bool deadCodeElimination{ false };
|
2017-12-17 15:59:29 +01:00
|
|
|
|
|
|
|
// 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
|
|
|
|
T_BuildConfigurations load( T_String const& path );
|
|
|
|
};
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
// 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){} };
|
|
|
|
};
|
|
|
|
|