Skip to content

fix: missing -fopenmp ldflags in gcc/clang when openmp is on#2639

Merged
nickclark2016 merged 2 commits intopremake:masterfrom
mercury233:patch-openmp-ldflags
Mar 11, 2026
Merged

fix: missing -fopenmp ldflags in gcc/clang when openmp is on#2639
nickclark2016 merged 2 commits intopremake:masterfrom
mercury233:patch-openmp-ldflags

Conversation

@mercury233
Copy link
Contributor

What does this PR do?

Fix premake wasn't adding -fopenmp to ldflags in gcc/clang when openmp is on. Without this flag, the program will fail to build with errors such as "undefined reference to `omp_get_thread_num'".

How does this PR change Premake's behavior?

-fopenmp is added to ldflags in the generated makefiles, so linkoptions { "-fopenmp" } is no longer required.

Anything else we should know?

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

Copy link
Member

@nickclark2016 nickclark2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, please squash into a single commit locally. LGTM.

@nickclark2016 nickclark2016 merged commit 6de61b9 into premake:master Mar 11, 2026
53 checks passed
@mercury233 mercury233 deleted the patch-openmp-ldflags branch March 12, 2026 02:56
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.

2 participants