compiler-research / CppInterOp

A Clang-based C++ Interoperability Library
Other
38 stars 20 forks source link

Implement detection of resource and include dirs. #204

Closed vgvassilev closed 3 months ago

vgvassilev commented 3 months ago

This is useful when deployed CppInterOp needs to create an interpreter. Often the interpreter itself cannot use the clang toolchain logic to discover both the resource-dir and the include paths. This is because CppInterOp is a library and usually put in the lib folder whereas the toolchain logic expects things to be relative to the bin folder.

In such setups, we can ask CppInterOp to detect the resource directory by asking clang about it. In the same vain, of finding C and C++ headers we can ask the system compiler about the include paths.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 88.23529% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 78.74%. Comparing base (687ae18) to head (f4fa34c).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204/graphs/tree.svg?width=650&height=150&src=pr&token=7UWTYSVVT5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research)](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) ```diff @@ Coverage Diff @@ ## main #204 +/- ## ========================================== + Coverage 78.63% 78.74% +0.10% ========================================== Files 8 8 Lines 3057 3091 +34 ========================================== + Hits 2404 2434 +30 - Misses 653 657 +4 ``` | [Files](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) | Coverage Δ | | |---|---|---| | [include/clang/Interpreter/CppInterOp.h](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-aW5jbHVkZS9jbGFuZy9JbnRlcnByZXRlci9DcHBJbnRlck9wLmg=) | `100.00% <ø> (ø)` | | | [lib/Interpreter/CppInterOp.cpp](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-bGliL0ludGVycHJldGVyL0NwcEludGVyT3AuY3Bw) | `86.36% <88.23%> (+0.03%)` | :arrow_up: | | [Files](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research) | Coverage Δ | | |---|---|---| | [include/clang/Interpreter/CppInterOp.h](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-aW5jbHVkZS9jbGFuZy9JbnRlcnByZXRlci9DcHBJbnRlck9wLmg=) | `100.00% <ø> (ø)` | | | [lib/Interpreter/CppInterOp.cpp](https://app.codecov.io/gh/compiler-research/CppInterOp/pull/204?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=compiler-research#diff-bGliL0ludGVycHJldGVyL0NwcEludGVyT3AuY3Bw) | `86.36% <88.23%> (+0.03%)` | :arrow_up: |