Skip to content

Commit

Permalink
Update analysis when Esp.Extensions changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Syeberman committed Nov 27, 2024
1 parent ee21754 commit e73d945
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
22 changes: 14 additions & 8 deletions Build/site_scons/msvs_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,18 @@ def cxx_analysis_emitter(target, source, env):
return _analysis_emitter(target, source, env, suffix)


CAnalysisAction = SCons.Action.Action(
"$SACCCOM", "$SACCCOMSTR", batch_key=msvc_batch_key, targets="$CHANGED_TARGETS"
)
CXXAnalysisAction = SCons.Action.Action(
"$SACXXCOM", "$SACXXCOMSTR", batch_key=msvc_batch_key, targets="$CHANGED_TARGETS"
)
def make_analysis_action(cmd, cmdstr):
return SCons.Action.Action(
cmd,
cmdstr,
batch_key=msvc_batch_key,
targets="$CHANGED_TARGETS",
varlist=["ENV['Esp.Extensions']"],
)


CAnalysisAction = make_analysis_action("$SACCCOM", "$SACCCOMSTR")
CXXAnalysisAction = make_analysis_action("$SACXXCOM", "$SACXXCOMSTR")


def generate_AnalysisBuilder(env):
Expand All @@ -51,9 +57,9 @@ def generate_AnalysisBuilder(env):

# SACC is the static analysis mode for CC, the C compiler (compare with SHCC et al)
# XXX Warnings are written to stdout.
# FIXME Code analysis also creates a log file named filename.nativecodeanalysis.xml, where
# TODO Code analysis can also create a log file named filename.nativecodeanalysis.xml, where
# filename is the name of the analyzed source file. I've disabled this for now with
# `/analyze:autolog-`... but should we prefer this?
# `/analyze:autolog-`... but should we prefer this over redirecting stdout?
# TODO Should SACXXFLAGS/etc reference CXXFLAGS/etc, like SHCXXFLAGS/etc does?
env["SACC"] = "$CC"
env["SACCCOM"] = (
Expand Down
2 changes: 0 additions & 2 deletions Build/site_scons/msvs_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ def addAnalysisFlags(*args):
env.AppendUnique(SACCFLAGS=list(args))

# TODO Are there other Espx engine plugins?
# FIXME Trigger recompilation when changed. When creating the Action, I think this will work:
# varlist=["ENV['Esp.Extensions']"]
env.AppendENVPath(
"Esp.Extensions",
[
Expand Down

0 comments on commit e73d945

Please sign in to comment.