waf: enable CAN on all SITL builds

This commit is contained in:
Andrew Tridgell 2023-08-26 11:34:24 +10:00
parent 3508d7eaa9
commit 61ca0df301
1 changed files with 11 additions and 6 deletions

View File

@ -626,10 +626,7 @@ Please use a replacement build as follows:
class sitl(Board):
def __init__(self):
if Utils.unversioned_sys_platform().startswith("linux"):
self.with_can = True
else:
self.with_can = False
def configure_env(self, cfg, env):
super(sitl, self).configure_env(cfg, env)
@ -656,6 +653,14 @@ class sitl(Board):
CANARD_IFACE_ALL = 0x3,
CANARD_ENABLE_CANFD = 1,
CANARD_ENABLE_ASSERTS = 1)
if not cfg.options.force_32bit:
# needed for cygwin
env.CXXFLAGS += [ '-DCANARD_64_BIT=1' ]
env.CFLAGS += [ '-DCANARD_64_BIT=1' ]
if Utils.unversioned_sys_platform().startswith("linux"):
cfg.define('HAL_CAN_WITH_SOCKETCAN', 1)
else:
cfg.define('HAL_CAN_WITH_SOCKETCAN', 0)
env.CXXFLAGS += [
'-Werror=float-equal',