Commit 0327124
authored
Make library inkcpp_shared public (#140)
### Context
Currently, using `add_subdirectory` or `FetchContent` in a CMake project
fails to compile. The compiler reports missing headers from the
**_inkcpp_shared_** library. A workaround is to explicitly link it:
> target_link_libraries(inkcpp_sample PRIVATE inkcpp inkcpp_compiler
**inkcpp_shared**)
However, this is only a quick fix.
### Problem
**_inkcpp_shared_** is a header-only library defined as an `INTERFACE`
target and is used in the public headers of the **_inkcpp_** and
**_inkcpp_compiler_** projects. However, both projects link
**_inkcpp_shared_** as a `PRIVATE` dependency, which prevents its
headers from being propagated to consumers.
This issue is not visible when **_inkcpp_** is installed, because the
public headers from **_inkcpp_shared_** are copied during installation.
### Solution
To fix the problem, **_inkcpp_shared_** should be linked `PUBLIC` so
that its headers are properly propagated as part of the public API of
both **_inkcpp_** and **_inkcpp_compiler_**.1 parent 763a119 commit 0327124
2 files changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments