Skip to content

Commit

Permalink
[gcc] Enable :stdc(++) module on hosted too
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Apr 8, 2020
1 parent bbd81eb commit f1021b0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
9 changes: 6 additions & 3 deletions ext/gcc/module_c++.lb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def prepare(module, options):
core = options[":target"].get_driver("core")["type"]
is_avr = core.startswith("avr")
is_cortex_m = core.startswith("cortex-m")
if not (is_avr or is_cortex_m):
return False

if is_avr:
module.add_option(
Expand All @@ -63,14 +61,19 @@ def prepare(module, options):
name="safe_statics", default=True,
description=descr_safe_statics))

module.depends(":architecture:assert", ":stdc")
if is_avr or is_cortex_m:
module.depends(":architecture:assert", ":stdc")

return True


def build(env):
core = env[":target"].get_driver("core")["type"]
is_avr = core.startswith("avr")
is_cortex_m = core.startswith("cortex-m")
if not (is_avr or is_cortex_m):
return

with_exceptions = env.get("exceptions", False)
with_threadsafe_statics = env.get("safe_statics", False)

Expand Down
13 changes: 7 additions & 6 deletions ext/gcc/module_c.lb
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ Additional compiler options:

def prepare(module, options):
core = options[":target"].get_driver("core")["type"]
if not (core.startswith("avr") or core.startswith("cortex-m")):
return False

module.depends(":architecture:assert")
if core.startswith("cortex-m0"):
module.depends(":architecture:atomic")
if core.startswith("avr") or core.startswith("cortex-m"):
module.depends(":architecture:assert")
if core.startswith("cortex-m0"):
module.depends(":architecture:atomic")

return True

def build(env):
core = env[":target"].get_driver("core")["type"]
if not (core.startswith("avr") or core.startswith("cortex-m")):
return

env.outbasepath = "modm/ext/gcc"

if core.startswith("cortex-m"):
Expand Down

0 comments on commit f1021b0

Please sign in to comment.