summaryrefslogtreecommitdiff
path: root/src/ctor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ctor.h')
-rw-r--r--src/ctor.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/ctor.h b/src/ctor.h
index 0892364..27b30af 100644
--- a/src/ctor.h
+++ b/src/ctor.h
@@ -90,6 +90,9 @@ enum class cxx_opt
output, // -o
debug, // -g
warn_all, // -Wall
+ warn_conversion, // -Wconversion
+ warn_shadow, // -Wshadow
+ warn_extra, // -Wextra
warnings_as_errors, // -Werror
generate_dep_tree, // -MMD
no_link, // -c
@@ -108,6 +111,9 @@ enum class c_opt
output, // -o
debug, // -g
warn_all, // -Wall
+ warn_conversion, // -Wconversion
+ warn_shadow, // -Wshadow
+ warn_extra, // -Wextra
warnings_as_errors, // -Werror
generate_dep_tree, // -MMD
no_link, // -c
@@ -124,7 +130,6 @@ enum class ld_opt
{
// gcc/clang
output, // -o
- strip, // -s
warn_all, // -Wall
warnings_as_errors, // -Werror
library_path, // -L<arg>
@@ -186,7 +191,7 @@ using asm_flag = ctor::flag<ctor::asm_opt>;
using c_flags = std::vector<ctor::c_flag>;
using cxx_flags = std::vector<ctor::cxx_flag>;
-using ld_flags= std::vector<ctor::ld_flag>;
+using ld_flags = std::vector<ctor::ld_flag>;
using ar_flags = std::vector<ctor::ar_flag>;
using asm_flags = std::vector<ctor::asm_flag>;
@@ -204,6 +209,7 @@ struct settings
std::string builddir{"build"};
std::size_t parallel_processes{1};
int verbose{0}; // -1: completely silent, 0: normal, 1: verbose, ...
+ bool dry_run{false};
};
struct build_configuration;
@@ -227,7 +233,7 @@ struct build_configuration
using build_configurations = std::vector<build_configuration>;
-int reg(ctor::build_configurations (*cb)(const ctor::settings&),
+int reg(std::function<ctor::build_configurations (const ctor::settings&)> cb,
const std::source_location location = std::source_location::current());
// This type will use flags verbatim
@@ -246,7 +252,7 @@ struct external_configuration
using external_configurations = std::vector<ctor::external_configuration>;
-int reg(ctor::external_configurations (*cb)(const ctor::settings&),
+int reg(std::function<ctor::external_configurations (const ctor::settings&)> cb,
const std::source_location location = std::source_location::current());
// Convenience macro - ugly but keeps things simple(r)
@@ -261,12 +267,12 @@ namespace cfg
constexpr auto builddir = "builddir";
constexpr auto host_cc = "host-cc";
-constexpr auto host_cxx = "host-cpp";
+constexpr auto host_cxx = "host-cxx";
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_cxx = "build-cxx";
constexpr auto build_ar = "build-ar";
constexpr auto build_ld = "build-ld";
@@ -277,7 +283,7 @@ constexpr auto ctor_libdir = "ctor-libdir";
struct configuration
{
bool has(const std::string& key) const;
- const std::string& get(const std::string& key, const std::string& default_value = {}) const;
+ std::string get(const std::string& key, const std::string& default_value = {}) const;
ctor::toolchain host_toolchain{ctor::toolchain::none};
ctor::arch host_arch{ctor::arch::unknown};
@@ -286,6 +292,8 @@ struct configuration
ctor::arch build_arch{ctor::arch::unknown};
std::vector<std::string> args; // vector of arguments used when last calling configure
+
+ std::string getenv(const std::string& key) const;
std::map<std::string, std::string> env; // env used when last calling configure
std::map<std::string, std::string> tools; // tools