Detect c++ standard unconditionally (needed for embed target)#944
Merged
Conversation
Member
Author
|
The commit removes |
Member
|
Looks good to me. I don't see any reason to keep the function. |
Currently select_cxx_standard(), which sets PYBIND11_CPP_STANDARD when
not externally set, is only called from pybind11_add_module(), but the
embed target setup (which runs unconditionally) makes use of
${PYBIND11_CPP_STANDARD}, which isn't set yet. This commit removes the
`select_cxx_standard` function completely and just always runs the
standard detection code.
This also tweaks the detection code to not bothering checking for the
`-std=c++11` flag when the `-std=c++14` detection succeeded.
jagerman
force-pushed
the
embed-cppversion
branch
from
July 16, 2017 06:29
6a25e16 to
0c790f6
Compare
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.
Currently
select_cxx_standard(), which setsPYBIND11_CPP_STANDARDwhen not externally set, is only called frompybind11_add_module(), but theembedtarget setup (which runs unconditionally) makes use of${PYBIND11_CPP_STANDARD}, which isn't set yet. This commit removes theselect_cxx_standardfunction completely and just always runs the standard detection code.This also tweaks the detection code to not bothering checking for the
-std=c++11flag when the-std=c++14detection succeeded.Fixes #943.
One odd thing about #943 is that when
pybind11_add_modulewas never called at all (and henceselect_cxx_standard()was never called at all), an embedded target would get thestd=c++14flag, but it's a mystery to me how that was happening.