Skip to content

Commit

Permalink
deal with CI that does -DUSE_CPU_EXTENSIONS=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Jan 28, 2025
1 parent ead4604 commit 92a5c0c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/system_info/print_system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ int main(void) {
fprintf(stdout, " 'amd_bmi2': %s\n", aws_cpu_has_feature(AWS_CPU_FEATURE_BMI2) ? "true" : "false");
fprintf(stdout, " }\n");

#if defined(AWS_USE_CPU_EXTENSIONS)
fprintf(stdout, " 'use cpu extensions': true\n");
#else
fprintf(stdout, " 'use cpu extensions': false\n");
#endif

fprintf(stdout, "}\n");
aws_system_environment_release(env);
aws_logger_clean_up(&logger);
Expand Down
8 changes: 8 additions & 0 deletions bin/system_info/test-print-system-info.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ def detect_features_from_app(app_path: Path) -> Dict[str, bool]:
name = m.group(1)
is_present = m.group(2) == 'true'
features[name] = is_present

# if aws-c-common compiled with -DUSE_CPU_EXTENSIONS=OFF, skip this this test
for line in lines:
m = re.search(f"'use cpu extensions': false", line)
if m:
print("SKIP TEST: aws-c-common compiled with -DUSE_CPU_EXTENSIONS=OFF")
exit(0)

if not features:
raise RuntimeError("Cannot find features text in stdout ???")

Expand Down

0 comments on commit 92a5c0c

Please sign in to comment.