diff --git a/brian2/devices/cpp_standalone/device.py b/brian2/devices/cpp_standalone/device.py index 151384080..e785893cd 100644 --- a/brian2/devices/cpp_standalone/device.py +++ b/brian2/devices/cpp_standalone/device.py @@ -1555,7 +1555,8 @@ def build( compiler_obj = ccompiler.new_compiler(compiler=compiler) compiler_flags = ( - ccompiler.gen_preprocess_options(define_macros, include_dirs) + [f"-D{k}" if v is None else f"-D{k}={v}" for k, v in define_macros] + + [f"-I'{include_dir}'" for include_dir in include_dirs] + extra_compile_args ) linker_flags = (