8
8
9
9
#!/usr/bin/env python3
10
10
11
- from os.path import join, abspath, realpath, dirname
12
- import shutil
11
+ from os.path import join, abspath
13
12
Import("env")
14
13
15
14
profile = ARGUMENTS.get("profile", "release")
@@ -28,25 +27,18 @@ env["COMPILERSUFFIX"] = "-12"
28
27
%% endif
29
28
%% endif
30
29
30
+ %% if toolpaths
31
31
# SCons tools
32
32
env.Append(toolpath=[
33
33
%% for toolpath in toolpaths | sort
34
34
abspath("{{ toolpath | modm.windowsify(escape_level=1) }}"),
35
35
%% endfor
36
36
])
37
+ %% endif
37
38
%% for tool in tools | sort
38
39
env.Tool("{{tool}}")
39
40
%% endfor
40
41
41
- c_compiler_name = env["CC"]
42
- c_compiler_path = shutil.which(c_compiler_name)
43
-
44
- if c_compiler_path is None:
45
- print(f'Selected compiler "{c_compiler_name}" not found on PATH. Please add its installation directory to the PATH environment variable.')
46
- exit(1)
47
-
48
- env["GCC_PATH"] = dirname(dirname(realpath(c_compiler_path)))
49
-
50
42
%% macro generate_flags_for_profile(name, profile, append=False)
51
43
env{% if append %}.Append({{name | upper}}{% else %}["{{name | upper}}"]{% endif %} = [
52
44
%% for flag in flags[name][profile] | sort
@@ -205,6 +197,7 @@ env.AppendUnique(LIBPATH=[
205
197
env.ParseConfig("pkg-config --cflags --libs {{ packages | sort | join(" ") }}")
206
198
%% endif
207
199
200
+ %% if is_modm
208
201
for flags in ["CCFLAGS", "CFLAGS", "CXXFLAGS", "ASFLAGS", "ARCHFLAGS", "LINKFLAGS"]:
209
202
flags_str = ARGUMENTS.get(flags)
210
203
if flags_str is not None:
@@ -220,5 +213,6 @@ for flags in ["CCFLAGS", "CFLAGS", "CXXFLAGS", "ASFLAGS", "ARCHFLAGS", "LINKFLAG
220
213
exit(1)
221
214
else:
222
215
env[flags].append(flag)
216
+ %% endif
223
217
224
218
Return("library")
0 commit comments