From 3737a3cf01b2cd8a91f5c7465cad475a882662df Mon Sep 17 00:00:00 2001 From: Marcel Stimberg Date: Mon, 2 Sep 2024 16:39:44 +0200 Subject: [PATCH] Quote include directory names for make file --- brian2/devices/cpp_standalone/device.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/brian2/devices/cpp_standalone/device.py b/brian2/devices/cpp_standalone/device.py index 151384080..a4050a512 100644 --- a/brian2/devices/cpp_standalone/device.py +++ b/brian2/devices/cpp_standalone/device.py @@ -1554,10 +1554,20 @@ def build( libraries = self.libraries + prefs["codegen.cpp.libraries"] + codeobj_libraries compiler_obj = ccompiler.new_compiler(compiler=compiler) + + # Distutils does not use the shell, so it does not need to quote filenames/paths + # Since we include the compiler flags in the makefile, we need to quote them + include_dirs = [f'"{include_dir}"' for include_dir in include_dirs] + library_dirs = [f'"{library_dir}"' for library_dir in library_dirs] + runtime_library_dirs = [ + f'"{runtime_dir}"' for runtime_dir in runtime_library_dirs + ] + compiler_flags = ( ccompiler.gen_preprocess_options(define_macros, include_dirs) + extra_compile_args ) + linker_flags = ( ccompiler.gen_lib_options( compiler_obj,