From b53f020b4703e024cdbea73abc210ee041604224 Mon Sep 17 00:00:00 2001 From: Philipp Kolberg Date: Thu, 2 Apr 2026 23:49:16 +0200 Subject: [PATCH] ISPC: Fix object suffix for dotted target names ISPC target names containing dots, such as `avx10.2dmr-x16`, produce output files with underscores in the ISA suffix (e.g. `_avx10_2dmr`). The `ComputeISPCObjectSuffixes` function did not account for this, causing a mismatch between the predicted and actual object file names. Replace dots with underscores in the extracted target suffix to match ISPC's `ISAToString()` behavior. Also add mappings for `sse4.1` and `sse4.2` target name variants, which ISPC both maps to `sse4`. --- Source/cmLocalGenerator.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 205141e037..5856af265b 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -5238,9 +5238,15 @@ std::vector ComputeISPCObjectSuffixes(cmGeneratorTarget* target) // transform targets into the suffixes auto pos = ispcTarget.find('-'); auto target_suffix = ispcTarget.substr(0, pos); + // ISPC uses underscores in output file suffixes where the target name + // has dots (e.g. "avx10.2dmr" produces files with "_avx10_2dmr" suffix) + std::replace(target_suffix.begin(), target_suffix.end(), '.', '_'); if (target_suffix == "avx1") { // when targeting avx1 ISPC uses the 'avx' output string target_suffix = "avx"; + } else if (target_suffix == "sse4_1" || target_suffix == "sse4_2") { + // when targeting sse4.1 or sse4.2 ISPC uses the 'sse4' output string + target_suffix = "sse4"; } ispcTarget = target_suffix; }