From 171ef10a6d8f0626e1e3e289b868f2a1dfd23c9b Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 1 Sep 2021 19:42:58 +0200 Subject: [PATCH] abacus: fix include directories This cleans up one of my major pain points with the Meson way of doing things. The Meson solution to have nice includes would have been to create an `include/` directory per library I create... --- CMakeLists.txt | 3 +++ src/abacus.cc | 2 +- src/bignum/CMakeLists.txt | 4 ---- src/parse/CMakeLists.txt | 2 +- src/parse/parser-driver.hh | 2 +- src/parse/parser.yy | 2 +- tests/unit/bignum.cc | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ef9a7b..d343e5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ target_compile_options(common_options INTERFACE -Wall -Wextra ) +target_include_directories(common_options INTERFACE + src +) add_subdirectory(src) add_subdirectory(tests) diff --git a/src/abacus.cc b/src/abacus.cc index 3e735a0..45d2394 100644 --- a/src/abacus.cc +++ b/src/abacus.cc @@ -1,4 +1,4 @@ -#include "parser-driver.hh" // FIXME: I would like `parse/parser-driver.hh` path instead... +#include "parse/parser-driver.hh" int main() { abacus::parse::ParserDriver driver{}; diff --git a/src/bignum/CMakeLists.txt b/src/bignum/CMakeLists.txt index b2434b7..6b64eb6 100644 --- a/src/bignum/CMakeLists.txt +++ b/src/bignum/CMakeLists.txt @@ -3,7 +3,3 @@ add_library(bignum STATIC bignum.hh ) target_link_libraries(bignum PRIVATE common_options) - -target_include_directories(bignum PUBLIC - $ -) diff --git a/src/parse/CMakeLists.txt b/src/parse/CMakeLists.txt index 3c87a92..22a706c 100644 --- a/src/parse/CMakeLists.txt +++ b/src/parse/CMakeLists.txt @@ -18,6 +18,6 @@ target_link_libraries(parse PRIVATE ) target_include_directories(parse PUBLIC - $ $ + $ ) diff --git a/src/parse/parser-driver.hh b/src/parse/parser-driver.hh index d5ba7ea..ad88efd 100644 --- a/src/parse/parser-driver.hh +++ b/src/parse/parser-driver.hh @@ -4,7 +4,7 @@ #include "parser.hh" -#include "bignum.hh" // FIXME: I would like `bignum/bignum.hh` path instead... +#include "bignum/bignum.hh" namespace abacus::parse { diff --git a/src/parse/parser.yy b/src/parse/parser.yy index d8fbc87..07e3e3a 100644 --- a/src/parse/parser.yy +++ b/src/parse/parser.yy @@ -36,7 +36,7 @@ namespace abacus::parse { class ParserDriver; } // namespace abacus::parse -#include "bignum.hh" // FIXME: I would like `bignum/bignum.hh` path instead... +#include "bignum/bignum.hh" } %code provides { diff --git a/tests/unit/bignum.cc b/tests/unit/bignum.cc index f584778..b7306f4 100644 --- a/tests/unit/bignum.cc +++ b/tests/unit/bignum.cc @@ -2,7 +2,7 @@ #include -#include "bignum.hh" +#include "bignum/bignum.hh" using namespace abacus::bignum;