-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpp: Require CXX_STANDARD 11 - fixes #578
Signed-off-by: Benn Snyder <benn.snyder@gmail.com>
- Loading branch information
Showing
2 changed files
with
8 additions
and
5 deletions.
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
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
3516072
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.
Hi,
I use cmake-3.16.5-Linux-x86_64 to build libfreenect and it fails, logs like below:
However, build can pass by add this tag, is this cmake bug?
3516072
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.
CMAKE_CXX_STANDARD
is supposed to just set the default value forCXX_STANDARD
so it should be the same. Maybe theDIRECTORY
part is not working. I think the right way to do this now is to addtarget_compile_features(mylib PUBLIC cxx_std_11)
to each target.3516072
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.
Thanks a lot for your reply!
Yes, you are right.
Refer to documents from cmake,
CXX_STANDARD
not including inProperties on Directories
.https://cmake.org/cmake/help/v3.16/manual/cmake-properties.7.html#directory-properties
3516072
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.
Aha, that makes sense - not every property can apply to the directory. Hopefully #614 will fix it for you.