From 73211561b879273297da49b179214d3e3b89d443 Mon Sep 17 00:00:00 2001 From: grvosku Date: Thu, 23 May 2024 15:56:35 -0600 Subject: [PATCH] Additional fix for CXX containing flags --- bin/sstcclib.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/bin/sstcclib.py b/bin/sstcclib.py index 413b3e354..01ab3ad60 100644 --- a/bin/sstcclib.py +++ b/bin/sstcclib.py @@ -311,11 +311,6 @@ def run(typ, extraLibs=""): ctx = Context() - for entry in sstCppFlags: - clean = cleanFlag(entry) - if clean: #don't add empty flags - ctx.cppFlags.append(clean) - ctx.sstCore = sstCore ctx.cc = spackcc if spackcc else cc ctx.cxx = spackcxx if spackcxx else cxx @@ -323,6 +318,21 @@ def run(typ, extraLibs=""): ctx.sstCore = sstCore ctx.hasClang = bool(clangCppFlagsStr) + # Workaround for CXX containing flags + if len(ctx.cxx.split()) > 1: + cxxFlags = ctx.cxx.split()[1:] + ctx.cxx = ctx.cxx.split()[0] + + for entry in cxxFlags: + clean = cleanFlag(entry) + if clean: #don't add empty flags + ctx.cppFlags.append(clean) + + for entry in sstCppFlags: + clean = cleanFlag(entry) + if clean: #don't add empty flags + ctx.cppFlags.append(clean) + #it is possible to override the host compilers use to do preprocessing/compilation if args.host_cxx: