Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for idirafter flag in GCC/Clang #2028

Merged
merged 1 commit into from
Apr 16, 2023

Conversation

nickclark2016
Copy link
Member

@nickclark2016 nickclark2016 commented Jan 30, 2023

What does this PR do?

Adds support for the -idirafter flag with GCC and Clang in the gmake2 and codelite exporters.

How does this PR change Premake's behavior?

No changes to the existing Premake behavior. Introduces includedirsafter API. For GCC and Clang utilizing the gmake2 or Codelite exporters, the directories specified by includedirsafter will utilize -idirafter flag for includes. For XCode using GCC or Clang, directories defined by includedirsafter will be at the end of the SYSTEM_HEADER_SEARCH_PATHS block. For Visual Studio using MSVC or Clang, directories defined by includedirsafter will at the end of the ExternalIncludePath element if in VS2019 or later or in the IncludePath element if 2017 or before. Similarly, if the MSC toolset is used, /external:I will be utilized for includedirsafter when using msc-142 or newer, or /I for msc-141 or earlier.

Anything else we should know?

Closes #2021

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!

modules/gmake2/tests/test_gmake2_includes.lua Outdated Show resolved Hide resolved
tests/tools/test_msc.lua Show resolved Hide resolved
website/docs/includedirsafter.md Outdated Show resolved Hide resolved
website/docs/includedirsafter.md Outdated Show resolved Hide resolved
website/sidebars.js Show resolved Hide resolved
@Jarod42
Copy link
Contributor

Jarod42 commented Feb 4, 2023

For info, UT added in my repo (using this branch), and as expected, core-generators pass, external module generators fail (see premake-sample-projects/actions includedirsafter_test)

s0600204 added a commit to s0600204/0ad that referenced this pull request Feb 24, 2023
s0600204 added a commit to s0600204/0ad that referenced this pull request Apr 11, 2023
@samsinsane samsinsane merged commit 9a318b0 into premake:master Apr 16, 2023
@Jarod42
Copy link
Contributor

Jarod42 commented Apr 16, 2023

@samsinsane : UTs are broken with that merge (due to previous merges).

@samsinsane
Copy link
Member

@Jarod42 thanks for pointing that out, I'll get that fixed up. Sorry about that!

@Jarod42 Jarod42 mentioned this pull request Apr 17, 2023
13 tasks
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.

Add support for vendored includes on linux.
3 participants