diff options
| author | ruki <[email protected]> | 2023-07-14 09:03:12 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-14 09:03:12 +0800 |
| commit | dcdeea0ef9feb0e601ac7350342504b36a8d99ee (patch) | |
| tree | 9f10a9d8a123cd90b516a09eacaf597e661c6443 | |
| parent | 7939d750e9dcd51b5bac3e4f4a7ead5a81b2bed0 (diff) | |
| parent | 60d6fe79e1c4d2def8e1561c142e427bd425e056 (diff) | |
Merge pull request #3966 from mohabouje/dev
Include directories for header-only libraries in CMake only support INTERFACE access types
| -rw-r--r-- | xmake/plugins/project/cmake/cmakelists.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/plugins/project/cmake/cmakelists.lua b/xmake/plugins/project/cmake/cmakelists.lua index 5ee2da1b1..12cec5bcb 100644 --- a/xmake/plugins/project/cmake/cmakelists.lua +++ b/xmake/plugins/project/cmake/cmakelists.lua @@ -467,7 +467,8 @@ end function _add_target_include_directories(cmakelists, target, outputdir) local includedirs = _get_configs_from_target(target, "includedirs") if #includedirs > 0 then - cmakelists:print("target_include_directories(%s PRIVATE", target:name()) + local access_type = target:kind() == "headeronly" and "INTERFACE" or "PRIVATE" + cmakelists:print("target_include_directories(%s %s", target:name(), access_type) for _, includedir in ipairs(includedirs) do cmakelists:print(" " .. _get_relative_unix_path(includedir, outputdir)) end |
