// -*- c++ -*- #pragma once #include #include //#include enum class TargetType { Auto, // Default - deduce from target name Executable, StaticLibrary, DynamicLibrary, }; struct BuildConfiguration { TargetType type{TargetType::Auto}; std::string target; std::vector sources; std::vector depends; std::vector cxxflags; std::vector cflags; std::vector ldflags; }; using BuildConfigurations = std::vector; int reg(const char* location, BuildConfigurations (*cb)()); // Convenience macro - ugly but keeps things simple(r) #define CONCAT(a, b) CONCAT_INNER(a, b) #define CONCAT_INNER(a, b) a ## b #define UNIQUE_NAME(base) CONCAT(base, __LINE__) #define REG(cb) namespace { int UNIQUE_NAME(unique) = reg(__FILE__, cb); }