summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ctor.cc1
-rw-r--r--src/ctor.h1
-rw-r--r--src/tools.cc8
-rw-r--r--test/ctor.cc12
-rw-r--r--test/suite/ctor_files/ctor.cc.bar1
-rw-r--r--test/suite/ctor_files/ctor.cc.base1
-rw-r--r--test/suite/ctor_files/ctor.cc.generated20
-rw-r--r--test/suite/ctor_files/ctor.cc.multi1
8 files changed, 45 insertions, 0 deletions
diff --git a/ctor.cc b/ctor.cc
index f3b8588..3dd1b59 100644
--- a/ctor.cc
+++ b/ctor.cc
@@ -43,6 +43,7 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
"-Wconversion",
// "-Wnrvo",
"-Isrc",
+ "-fexceptions",
},
},
}
diff --git a/src/ctor.h b/src/ctor.h
index dddc5ef..8b86aec 100644
--- a/src/ctor.h
+++ b/src/ctor.h
@@ -127,6 +127,7 @@ enum class cxx_opt
warn_shadow, // -Wshadow
warn_extra, // -Wextra
warnings_as_errors, // -Werror
+ exceptions, // -fexceptions
generate_dep_tree, // -MMD
no_link, // -c
include_path, // -I<arg>
diff --git a/src/tools.cc b/src/tools.cc
index 9dcaec6..f8662cc 100644
--- a/src/tools.cc
+++ b/src/tools.cc
@@ -51,6 +51,7 @@ std::ostream& operator<<(std::ostream& stream, const ctor::cxx_opt& opt)
case ctor::cxx_opt::warn_shadow: stream << "ctor::cxx_opt::warn_shadow"; break;
case ctor::cxx_opt::warn_extra: stream << "ctor::cxx_opt::warn_extra"; break;
case ctor::cxx_opt::warnings_as_errors: stream << "ctor::cxx_opt::warnings_as_errors"; break;
+ case ctor::cxx_opt::exceptions: stream << "ctor::cxx_opt::exceptions"; break;
case ctor::cxx_opt::generate_dep_tree: stream << "ctor::cxx_opt::generate_dep_tree"; break;
case ctor::cxx_opt::no_link: stream << "ctor::cxx_opt::no_link"; break;
case ctor::cxx_opt::include_path: stream << "ctor::cxx_opt::include_path"; break;
@@ -357,6 +358,11 @@ ctor::cxx_flag cxx_option(std::string_view flag)
return { ctor::cxx_opt::warn_extra};
}
+ if(flag.starts_with("-fexceptions"))
+ {
+ return { ctor::cxx_opt::exceptions};
+ }
+
if(flag.starts_with("-g"))
{
return { ctor::cxx_opt::debug };
@@ -420,6 +426,8 @@ std::vector<std::string> cxx_option(ctor::cxx_opt opt, std::string_view arg,
return {"-Wextra"};
case ctor::cxx_opt::warnings_as_errors:
return {"-Werror"};
+ case ctor::cxx_opt::exceptions:
+ return {"-fexceptions"};
case ctor::cxx_opt::generate_dep_tree:
return {"-MMD"};
case ctor::cxx_opt::no_link:
diff --git a/test/ctor.cc b/test/ctor.cc
index 8b89f6d..053e4e6 100644
--- a/test/ctor.cc
+++ b/test/ctor.cc
@@ -22,6 +22,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"argparser\"",
+ "-fexceptions",
},
},
},
@@ -39,6 +40,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"generated_sources\"",
+ "-fexceptions",
},
},
},
@@ -56,6 +58,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"argsplit\"",
+ "-fexceptions",
},
},
},
@@ -73,6 +76,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"pointerlist\"",
+ "-fexceptions",
},
},
},
@@ -92,6 +96,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"deps\"",
+ "-fexceptions",
},
},
},
@@ -105,6 +110,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
.flags = {
.cxxflags = {
"-std=c++20", "-O3", "-Wall",
+ "-fexceptions",
},
},
},
@@ -125,6 +131,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"execute\"",
+ "-fexceptions",
},
.ldflags = { "-pthread" },
},
@@ -143,6 +150,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tasks\"",
+ "-fexceptions",
},
.ldflags = { "-pthread" },
},
@@ -161,6 +169,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"cycle\"",
+ "-fexceptions",
},
.ldflags = { "-pthread" },
},
@@ -179,6 +188,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"source_type\"",
+ "-fexceptions",
},
.ldflags = { "-pthread" },
},
@@ -199,6 +209,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
"-std=c++20", "-O3", "-Wall",
"-I../src", "-Iuunit",
"-DOUTPUT=\"tools\"",
+ "-fexceptions",
},
},
},
@@ -228,6 +239,7 @@ ctor::build_configurations ctorTestConfigs(const ctor::settings& settings)
.cxxflags = {
"-std=c++20", "-O3", "-Wall",
"-I../src",
+ "-fexceptions",
},
.ldflags = { "-pthread" },
},
diff --git a/test/suite/ctor_files/ctor.cc.bar b/test/suite/ctor_files/ctor.cc.bar
index 218f9cc..ab88379 100644
--- a/test/suite/ctor_files/ctor.cc.bar
+++ b/test/suite/ctor_files/ctor.cc.bar
@@ -23,6 +23,7 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
"-g",
"-Wall",
"-Werror",
+ "-fexceptions",
},
},
.externals = {"bar"},
diff --git a/test/suite/ctor_files/ctor.cc.base b/test/suite/ctor_files/ctor.cc.base
index eab39c4..a8b3c92 100644
--- a/test/suite/ctor_files/ctor.cc.base
+++ b/test/suite/ctor_files/ctor.cc.base
@@ -23,6 +23,7 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
"-g",
"-Wall",
"-Werror",
+ "-fexceptions",
},
},
.externals = {"bar"},
diff --git a/test/suite/ctor_files/ctor.cc.generated b/test/suite/ctor_files/ctor.cc.generated
index 5bc2940..d4b9786 100644
--- a/test/suite/ctor_files/ctor.cc.generated
+++ b/test/suite/ctor_files/ctor.cc.generated
@@ -17,12 +17,32 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
.sources = {
{ "world.cc", ctor::source_type::generated },
},
+ .flags = {
+ .cxxflags = {
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
+ },
+ },
},
{
.target = "foo",
.sources = {
{ "foo.cc", ctor::source_type::generated },
},
+ .flags = {
+ .cxxflags = {
+ "-std=c++20",
+ "-O3",
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-fexceptions",
+ },
+ },
},
{
.target = "this_is_unused",
diff --git a/test/suite/ctor_files/ctor.cc.multi b/test/suite/ctor_files/ctor.cc.multi
index 2b88afe..157d96c 100644
--- a/test/suite/ctor_files/ctor.cc.multi
+++ b/test/suite/ctor_files/ctor.cc.multi
@@ -25,6 +25,7 @@ ctor::build_configurations ctorConfigs(const ctor::settings& settings)
"-g",
"-Wall",
"-Werror",
+ "-fexceptions",
},
},
.externals = {"bar"},