Skip to content

Commit

Permalink
Merge c72093a into e673ace
Browse files Browse the repository at this point in the history
  • Loading branch information
mstimberg committed May 6, 2022
2 parents e673ace + c72093a commit 3682f64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion brian2/codegen/cpp_prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ def _determine_flag_compatibility(compiler, flagname):
with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f, std_silent():
f.write('int main (int argc, char **argv) { return 0; }')
try:
compiler.compile([f.name], extra_postargs=[flagname])
object_files = compiler.compile([f.name],
output_dir=os.path.dirname(f.name),
extra_postargs=[flagname])
for object_file in object_files:
os.unlink(object_file)
except CompileError:
logger.warn(f"Removing unsupported flag '{flagname}' from "
f'compiler flags.')
Expand Down

0 comments on commit 3682f64

Please sign in to comment.