-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Try removing attempt to set the C++ standard #1464
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d4f3f22
Try removing attempt to set the C++ standard
dmah42 741fd11
set the standard to 11
dmah42 7cba0e1
spell it right
dmah42 b9f93e4
had it right the first time
dmah42 d89c96a
require std 11
dmah42 5a10935
plumb through the standard to cxxfeaturecheck
dmah42 1f7866e
use policy instead
dmah42 3b1a041
can't use policy just yet
dmah42 8d21a92
Update CXXFeatureCheck.cmake
dominichamon 1627c9a
Merge branch 'main' into std
dmah42 d765fa5
fix CXX_STANDARD_REQUIRED statement
dmah42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ foreach(p | |
CMP0056 # export EXE_LINKER_FLAGS to try_run | ||
CMP0057 # Support no if() IN_LIST operator | ||
CMP0063 # Honor visibility properties for all targets | ||
# TODO: enable when cmake bumps above 3.8 | ||
# CMP0067 # Honor language standard in try_compile() source file signature | ||
CMP0077 # Allow option() overrides in importing projects | ||
) | ||
if(POLICY ${p}) | ||
|
@@ -137,6 +139,10 @@ if (BENCHMARK_BUILD_32_BITS) | |
add_required_cxx_compiler_flag(-m32) | ||
endif() | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not meaningful. MSVC, for instance, does not provide exclusive C++11 support, only C++14 and later: https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170. CMake will probably decay to the newer standard anyway. |
||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
if (MSVC) | ||
# Turn compiler warnings up to 11 | ||
string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | ||
|
@@ -169,13 +175,6 @@ if (MSVC) | |
set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /LTCG") | ||
endif() | ||
else() | ||
# Try and enable C++11. Don't use C++14 because it doesn't work in some | ||
# configurations. | ||
add_cxx_compiler_flag(-std=c++11) | ||
if (NOT HAVE_CXX_FLAG_STD_CXX11) | ||
add_cxx_compiler_flag(-std=c++0x) | ||
endif() | ||
|
||
# Turn compiler warnings up to 11 | ||
add_cxx_compiler_flag(-Wall) | ||
add_cxx_compiler_flag(-Wextra) | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably also want
CMAKE_CXX_EXTENSIONS OFF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah.. i'm also eyeing up the check where we:
and wondering how that will end up interacting with this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes FWIW we need this check for clang on windows.