Skip to content

Commit 3a273f7

Browse files
committed
Create and enable exporter flag mbed_conf_active for exporters
The mbed_conf_active feature disables configuration macros on the command line and replaces them with a preinclude header file
1 parent c06dad5 commit 3a273f7

File tree

9 files changed

+24
-5
lines changed

9 files changed

+24
-5
lines changed

tools/export/atmelstudio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class AtmelStudio(Exporter):
3333

3434
DOT_IN_RELATIVE_PATH = True
3535

36+
MBED_CONF_ACTIVE = True
37+
3638
def generate(self):
3739

3840
source_files = []

tools/export/codered.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class CodeRed(Exporter):
2222
NAME = 'CodeRed'
2323
TOOLCHAIN = 'GCC_CR'
2424

25+
MBED_CONF_ACTIVE = True
26+
2527
TARGETS = [
2628
'LPC1768',
2729
'LPC4088',

tools/export/emblocks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class IntermediateFile(Exporter):
3131
# we support all GCC targets (is handled on IDE side)
3232
TARGETS = gccTargets
3333

34+
MBED_CONF_ACTIVE = True
35+
3436
FILE_TYPES = {
3537
'headers': 'h',
3638
'c_sources': 'c',

tools/export/exporters.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,15 @@ def scan_and_copy_resources(self, prj_paths, trg_path, relative=False):
171171
# Loads the resources into the config system which might expand/modify resources based on config data
172172
self.resources = config.load_resources(resources)
173173

174-
# And add the configuration macros to the toolchain
175-
self.config_macros = config.get_config_data_macros()
176174

177-
# Add the configuration file to the target directory
178-
self.config_header = "mbed_conf.h"
179-
config.get_config_data_header(join(trg_path, self.config_header))
175+
if hasattr(self, "MBED_CONF_ACTIVE") and self.MBED_CONF_ACTIVE :
176+
# Add the configuration file to the target directory
177+
self.config_header = "mbed_conf.h"
178+
config.get_config_data_header(join(trg_path, self.config_header))
179+
self.config_macros = []
180+
else :
181+
# And add the configuration macros to the toolchain
182+
self.config_macros = config.get_config_data_macros()
180183
# Check the existence of a binary build of the mbed library for the desired target
181184
# This prevents exporting the mbed libraries from source
182185
# if not self.toolchain.mbed_libs:

tools/export/gccarm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class GccArm(Exporter):
121121

122122
DOT_IN_RELATIVE_PATH = True
123123

124+
MBED_CONF_ACTIVE = True
125+
124126
def generate(self):
125127
# "make" wants Unix paths
126128
self.resources.win_to_unix()

tools/export/iar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class IAREmbeddedWorkbench(Exporter):
3333
# PROGEN_ACTIVE contains information for exporter scripts that this is using progen
3434
PROGEN_ACTIVE = True
3535

36+
MBED_CONF_ACTIVE = True
37+
3638
# backward compatibility with our scripts
3739
TARGETS = []
3840
for target in TARGET_NAMES:

tools/export/simplicityv3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ class SimplicityV3(Exporter):
101101

102102
DOT_IN_RELATIVE_PATH = False
103103

104+
MBED_CONF_ACTIVE = True
105+
104106
orderedPaths = Folder("Root")
105107

106108
def check_and_add_path(self, path):

tools/export/uvision4.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class Uvision4(Exporter):
3434
# PROGEN_ACTIVE contains information for exporter scripts that this is using progen
3535
PROGEN_ACTIVE = True
3636

37+
MBED_CONF_ACTIVE = True
38+
3739
# backward compatibility with our scripts
3840
TARGETS = []
3941
for target in TARGET_NAMES:

tools/export/uvision5.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class Uvision5(Exporter):
3434
# PROGEN_ACTIVE contains information for exporter scripts that this is using progen
3535
PROGEN_ACTIVE = True
3636

37+
MBED_CONF_ACTIVE = True
38+
3739
# backward compatibility with our scripts
3840
TARGETS = []
3941
for target in TARGET_NAMES:

0 commit comments

Comments
 (0)