From 73937730e09969edac1a56f36ef3bcbb5004a3f0 Mon Sep 17 00:00:00 2001 From: lyken Date: Sun, 14 Jul 2024 17:09:48 +0800 Subject: [PATCH] core: -I irrt/ & #include absolute paths --- nac3core/build.rs | 4 ++++ nac3core/irrt/irrt.cpp | 2 +- nac3core/irrt/irrt/core.hpp | 4 ++-- nac3core/irrt/irrt_everything.hpp | 8 +++++--- nac3core/irrt/irrt_test.cpp | 6 +++--- nac3core/irrt/test/core.hpp | 4 ++-- nac3core/irrt/test/test_core.hpp | 4 ++-- 7 files changed, 19 insertions(+), 13 deletions(-) diff --git a/nac3core/build.rs b/nac3core/build.rs index 0c9d6407..33cf3da9 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -46,6 +46,8 @@ fn compile_irrt_cpp() { "-Wall", "-Wextra", "-Werror=return-type", + "-I", + irrt_dir.to_str().unwrap(), "-o", "-", irrt_cpp_path.to_str().unwrap(), @@ -133,6 +135,8 @@ fn compile_irrt_test_cpp() { "-Wextra", "-Werror=return-type", "-lm", // for `tgamma()`, `lgamma()` + "-I", + irrt_dir.to_str().unwrap(), "-o", exe_path.to_str().unwrap(), ]; diff --git a/nac3core/irrt/irrt.cpp b/nac3core/irrt/irrt.cpp index 489ce090..f6e41655 100644 --- a/nac3core/irrt/irrt.cpp +++ b/nac3core/irrt/irrt.cpp @@ -1,5 +1,5 @@ #define IRRT_DEFINE_TYPEDEF_INTS -#include "irrt_everything.hpp" +#include /* All IRRT implementations. diff --git a/nac3core/irrt/irrt/core.hpp b/nac3core/irrt/irrt/core.hpp index 31bec3fc..88a7e418 100644 --- a/nac3core/irrt/irrt/core.hpp +++ b/nac3core/irrt/irrt/core.hpp @@ -1,7 +1,7 @@ #pragma once -#include "utils.hpp" -#include "int_defs.hpp" +#include +#include // NDArray indices are always `uint32_t`. using NDIndex = uint32_t; diff --git a/nac3core/irrt/irrt_everything.hpp b/nac3core/irrt/irrt_everything.hpp index 63e3e63a..a1c45e1e 100644 --- a/nac3core/irrt/irrt_everything.hpp +++ b/nac3core/irrt/irrt_everything.hpp @@ -1,3 +1,5 @@ -#include "irrt/core.hpp" -#include "irrt/int_defs.hpp" -#include "irrt/utils.hpp" \ No newline at end of file +#pragma once + +#include +#include +#include \ No newline at end of file diff --git a/nac3core/irrt/irrt_test.cpp b/nac3core/irrt/irrt_test.cpp index 8aa64c2f..fefcd2a0 100644 --- a/nac3core/irrt/irrt_test.cpp +++ b/nac3core/irrt/irrt_test.cpp @@ -5,10 +5,10 @@ #include #include -#include "irrt_everything.hpp" +#include -#include "test/core.hpp" -#include "test/test_core.hpp" +#include +#include int main() { test_int_exp(); diff --git a/nac3core/irrt/test/core.hpp b/nac3core/irrt/test/core.hpp index 34063aa4..5230bbf6 100644 --- a/nac3core/irrt/test/core.hpp +++ b/nac3core/irrt/test/core.hpp @@ -6,10 +6,10 @@ #include #include -#include "print.hpp" +#include // Some utils can be used here -#include "../irrt/utils.hpp" +#include void __begin_test(const char* function_name, const char* file, int line) { printf("######### Running %s @ %s:%d\n", function_name, file, line); diff --git a/nac3core/irrt/test/test_core.hpp b/nac3core/irrt/test/test_core.hpp index ec2a5493..09b0c08a 100644 --- a/nac3core/irrt/test/test_core.hpp +++ b/nac3core/irrt/test/test_core.hpp @@ -1,7 +1,7 @@ #pragma once -#include "core.hpp" -#include "../irrt/core.hpp" +#include +#include void test_int_exp() { BEGIN_TEST();