From 5da56616cccf4e595ec6a556cf1aef40b37746e3 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 28 Aug 2021 18:59:29 +0200 Subject: Move sources to ... well, src ;) --- libcppbuild.h | 76 ----------------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 libcppbuild.h (limited to 'libcppbuild.h') diff --git a/libcppbuild.h b/libcppbuild.h deleted file mode 100644 index d0a0080..0000000 --- a/libcppbuild.h +++ /dev/null @@ -1,76 +0,0 @@ -// -*- c++ -*- -#pragma once - -#include -#include -#include - -enum class TargetType -{ - Auto, // Default - deduce from target name and sources extensions - - Executable, - StaticLibrary, - DynamicLibrary, - Object, -}; - -enum class Language -{ - Auto, // Default - deduce language from source extensions - - C, - Cpp, - Asm, -}; - -enum class OutputSystem -{ - Host, // Output for the target system - Build, // Internal tool during cross-compilation -}; - -struct BuildConfiguration -{ - TargetType type{TargetType::Auto}; - Language language{Language::Auto}; - OutputSystem system{OutputSystem::Host}; - std::string target; - std::vector sources; // source list - std::vector depends; // internal dependencies - std::vector cxxflags; // flags for c++ compiler - std::vector cflags; // flags for c compiler - std::vector ldflags; // flags for linker - std::vector asmflags; // flags for asm translator -}; - -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); } - -// Predefined configuration keys -namespace cfg -{ -constexpr auto builddir = "builddir"; - -constexpr auto host_cc = "host-cc"; -constexpr auto host_cxx = "host-cpp"; -constexpr auto host_ar = "host-ar"; -constexpr auto host_ld = "host-ld"; - -constexpr auto build_cc = "build-cc"; -constexpr auto build_cxx = "build-cpp"; -constexpr auto build_ar = "build-ar"; -constexpr auto build_ld = "build-ld"; -} - -const std::map& configuration(); -bool hasConfiguration(const std::string& key); -const std::string& getConfiguration(const std::string& key, - const std::string& defaultValue = {}); -- cgit v1.2.3