Skip to content

Commit 97ffcb4

Browse files
committed
[cmake] Emulate scons behaviour of including everything
1 parent 2f51822 commit 97ffcb4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

tools/build_script_generator/cmake/module.lb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def post_build(env):
142142
files = []
143143
per_file_attr = []
144144
repo_filter = lambda scope: scope.repository == repo
145+
inv_repo_filter = lambda scope: scope.repository != repo
145146
repo_flags = env.query("::collect_flags")(env, repo_filter)
146147

147148
warning_pattern = re.compile("^-W")
@@ -174,6 +175,9 @@ def post_build(env):
174175
files.append( (sfile, profiles) )
175176

176177
include_paths = env.collector_values("::path.include", filterfunc=repo_filter)
178+
private_include_paths = env.collector_values(
179+
"::path.include", filterfunc=inv_repo_filter
180+
)
177181
libary_paths = env.collector_values("::path.library", filterfunc=repo_filter)
178182
libaries = env.collector_values("::library", filterfunc=repo_filter)
179183
packages = env.collector_values("::pkg-config", filterfunc=repo_filter)
@@ -188,6 +192,7 @@ def post_build(env):
188192
"libraries": libaries,
189193
"library_paths": libary_paths,
190194
"include_paths": include_paths,
195+
"private_include_paths": private_include_paths,
191196
"packages": packages,
192197
"is_modm": repo == "modm",
193198
"per_file_attr": file_attrs,

tools/build_script_generator/cmake/resources/CMakeLists.txt.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ target_include_directories({{ repo }} SYSTEM
5959
%% for path in include_paths | sort
6060
{{ path | relocate | modm.posixify }}
6161
%% endfor
62+
%% if sources | length
63+
PRIVATE
64+
%% for path in private_include_paths | sort
65+
{{ path | relocate | modm.posixify }}
66+
%% endfor
67+
%% endif
6268
)
6369

6470
%% endif

0 commit comments

Comments
 (0)