demotool/c-buildcfg.hh
Emmanuel BENOîT c7e4ccf67e Builder tool - Various, pre-constant propagation
+ Prepared flags for constant propagation
+ UI instructions removal in compiler
+ Various changes to test "demo"
2017-12-03 14:59:39 +01:00

63 lines
1.7 KiB
C++

#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 };
// Dead code elimination -----------------------------------------------
bool deadCodeElimination{ false };
};
// 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){} };
};