[feature] Autodetect <target-os> from compiler triplet - #609
Open
uilianries wants to merge 6 commits into
Open
Conversation
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Signed-off-by: Uilian Ries <uilianries@gmail.com>
Contributor
Author
|
Test errors are unrelated to this PR changes:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Proposed changes
Greetings! 👋
While working on the Conan Center boost recipe, cross-compiling required the recipe to compute and pass
target-os=explicitly for every target (expected as explicitly documented at https://www.bfgroup.xyz/b2/manual/release/index.html#b2.tasks.crosscompile), even though the compiler itself already knows what it's targeting.The gcc.jam already runs
-dumpmachine, and maps the resulting triple to a<target-os>value, and registers it as a default viatoolset.add-defaults.On the other hand, clang-linux.jam and clang-darwin.jam have no equivalent, when cross-building with clang, it falls back to the host OS unless
target-os=is passed.This PR updates the
clang.set-target-os-defaultto follow the same auto-detect rule as used ingcc.jam. I also extendedgcc.jam, so both clang and gcc match in terms of OS cases.I also added a new test to validate it, by mocking the triplet and asking b2 to deduce the target-os.
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.