Skip to content

Commit

Permalink
Quote include directory names for make file
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed Sep 2, 2024
1 parent 6f60168 commit 3737a3c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions brian2/devices/cpp_standalone/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3737a3c

Please sign in to comment.