Skip to content

fix(cmake): remove redundant OpenMP compile flags in non-Homebrew path#234

Merged
esmuellert merged 2 commits intoesmuellert:mainfrom
milan-panta:fix/cmake-redundant-openmp-flags
Feb 11, 2026
Merged

fix(cmake): remove redundant OpenMP compile flags in non-Homebrew path#234
esmuellert merged 2 commits intoesmuellert:mainfrom
milan-panta:fix/cmake-redundant-openmp-flags

Conversation

@milan-panta
Copy link
Contributor

@milan-panta milan-panta commented Feb 8, 2026

Summary

  • Remove redundant target_compile_options for OpenMP in the standard (non-Homebrew) CMake path
  • Move target_compile_options into the HOMEBREW_OPENMP branch where it's actually needed

Why

On newer CMake (4.x+), find_package(OpenMP) succeeds on macOS, bypassing the Homebrew fallback. In the standard path, target_compile_options added ${OpenMP_C_FLAGS} as a single quoted argument ("-Xclang -fopenmp"), which clang rejects. This was redundant since OpenMP::OpenMP_C already propagates compile flags via INTERFACE_COMPILE_OPTIONS.

Test plan

  • CI build matrix covers Linux x64/ARM64, macOS x64/ARM64, Windows x64/ARM64
  • Verified locally on macOS with CMake 4.x

Resolves: #237.

On newer CMake (4.x+), find_package(OpenMP) succeeds on macOS,
bypassing the Homebrew fallback. In the standard path,
target_compile_options added ${OpenMP_C_FLAGS} as a single quoted
argument ("-Xclang -fopenmp"), which clang rejects. This was
redundant since OpenMP::OpenMP_C already propagates compile flags
via INTERFACE properties.

Move target_compile_options into the HOMEBREW_OPENMP branch where
it's actually needed, and remove it from the standard path.
@esmuellert esmuellert enabled auto-merge February 11, 2026 04:15
@esmuellert esmuellert merged commit 13957f6 into esmuellert:main Feb 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build issues on MacOS.

2 participants