fix(cmake): remove redundant OpenMP compile flags in non-Homebrew path #233
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
target_compile_options(... ${OpenMP_C_FLAGS})from the non-Homebrew OpenMP path, whereOpenMP::OpenMP_Calready propagates compile flags via INTERFACE propertiestarget_compile_optionsinside theHOMEBREW_OPENMPbranch for test and diff tool targets, where it's actually neededProblem: On CMake 4.x+,
find_package(OpenMP)now succeeds natively on macOS with Apple Clang + Homebrew libomp, bypassing the manual Homebrew fallback. In the standard path,${OpenMP_C_FLAGS}expands to the string"-Xclang -fopenmp"whichtarget_compile_optionspasses as a single quoted argument — causingclang: error: unknown argument: '-Xclang -fopenmp'. This was also redundant sinceOpenMP::OpenMP_Calready adds the same flags correctly.Affected targets:
vscode_diff, test executables,diffCLI tool.No impact on Linux/Windows —
OpenMP::OpenMP_Chas carried compile flags via INTERFACE properties since CMake 3.9 (project requires 3.15+). No impact on the Homebrew fallback path, which is unchanged.