Skip to content

Commit f4f1f6e

Browse files
committed
[EFM32] Fix exporter to pull root path
Simplicity Studio exporter doesnt really support header files in the root directory (looking at you, mbed_config.h), so this is a workaround for that issue.
1 parent e9d0fbd commit f4f1f6e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tools/export/simplicityv3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def generate(self):
175175
## Strip main folder from include paths because ssproj is not capable of handling it
176176
if '.' in ctx['include_paths']:
177177
ctx['include_paths'].remove('.')
178+
ctx['include_root'] = True
178179

179180
'''
180181
Suppress print statements

tools/export/simplicityv3_slsproj.tmpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,19 @@
1818
{%- for file in main_files -%}
1919
<file name = "{{ file }}" uri = "file:./{{ file }}" partCompatibility = ""/>
2020
{%- endfor %}
21+
{%- if include_root %}
22+
<file name = "mbed_config.h" uri = "file:./mbed_config.h" partCompatibility = ""/>
23+
{%- endif %}
2124

2225
<sourceFolder></sourceFolder>
2326
<model:property key="cppProjectCommon.languageId" value="org.eclipse.cdt.core.g++"/>
2427
<model:property key="projectCommon.buildArtifactType" value="EXE"/>
2528
<configuration name="com.silabs.ide.si32.gcc.debug#com.silabs.ide.si32.gcc:4.8.3.20131129" label="GNU ARM v4.8.3 - Debug" stockConfigCompatibility="com.silabs.ide.toolchain.core.debug">
2629
<model:description></model:description>
2730
{# Add all include paths to the managed build compiler, paths relative to project #}
31+
{%- if include_root %}
32+
<includePath languageCompatibility="c cpp" uri="."/>
33+
{%- endif %}
2834
{%- for path in include_paths %}
2935
<includePath languageCompatibility="c cpp" uri="studio:/project/{{ path }}/"/>
3036
{%- endfor %}
@@ -83,6 +89,9 @@
8389
<configuration name="com.silabs.ide.si32.gcc.release#com.silabs.ide.si32.gcc:4.8.3.20131129" label="GNU ARM v4.8.3 - Release" stockConfigCompatibility="com.silabs.ide.toolchain.core.release">
8490
<model:description></model:description>
8591
{# Add all include paths to the managed build compiler, paths relative to project #}
92+
{%- if include_root %}
93+
<includePath languageCompatibility="c cpp" uri="."/>
94+
{%- endif %}
8695
{%- for path in include_paths %}
8796
<includePath languageCompatibility="c cpp" uri="studio:/project/{{ path }}/"/>
8897
{%- endfor %}

0 commit comments

Comments
 (0)