-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Require C++11 support with CMake functions. #1027
Require C++11 support with CMake functions. #1027
Conversation
This PR replaces PR facebookarchive#464. It requires C+11 support using the new CMake variables (CMAKE_CXX_STANDARD, CMAKE_CXX_STANDARD_REQUIRED, etc.) when CMake is version 3.1 or above. Otherwise, if CMake is older (e.g. Ubuntu 14.04) it falls back to using the -std=c++11 flag and issues a warning. This PR is based on the comment from @Yangqing: facebookarchive#464 (comment) The corresponding line in cmake/MiscCheck.cmake is removed in order to reduce redundancy.
@Yangqing has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
@Yangqing has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
I still feel this kinda defeats the purpose of using these cmake functions in the first place.. what's the benefit now? |
In fact, this breaks contbuild so I'll revert it... |
Sorry for the issues with contbuild. I have just signed up for Travis and will check with it next time. The main benefit from this code is that it throws an error if c++11 is not supported, rather than throwing a more obscure error on c++11 specific code. This could be accomplished by:
although this would not work for compilers that do not support -std=c++11 (MSVC?). I'm guessing requiring this is pretty low priority? |
Summary: This PR replaces PR #464. It requires C+11 support using the new CMake variables (`CMAKE_CXX_STANDARD`, `CMAKE_CXX_STANDARD_REQUIRED`, etc.) when CMake is version 3.1 or above. Otherwise, if CMake is older (e.g. Ubuntu 14.04) it falls back to using the -std=c++11 flag and issues a warning. This PR is based on the comment from Yangqing: facebookarchive/caffe2#464 (comment) The corresponding line in cmake/MiscCheck.cmake is removed in order to reduce redundancy. Another option would be to move the C++11 logic to MiscCheck.cmake. Closes facebookarchive/caffe2#1027 Differential Revision: D5590646 Pulled By: Yangqing fbshipit-source-id: 11ac63fbeaab7a1da02115549e214f9c529f1873
Summary: This PR replaces PR #464. It requires C+11 support using the new CMake variables (`CMAKE_CXX_STANDARD`, `CMAKE_CXX_STANDARD_REQUIRED`, etc.) when CMake is version 3.1 or above. Otherwise, if CMake is older (e.g. Ubuntu 14.04) it falls back to using the -std=c++11 flag and issues a warning. This PR is based on the comment from Yangqing: facebookarchive/caffe2#464 (comment) The corresponding line in cmake/MiscCheck.cmake is removed in order to reduce redundancy. Another option would be to move the C++11 logic to MiscCheck.cmake. Closes facebookarchive/caffe2#1027 Differential Revision: D5590646 Pulled By: Yangqing fbshipit-source-id: 11ac63fbeaab7a1da02115549e214f9c529f1873
This PR replaces PR #464. It requires C+11 support using the
new CMake variables (
CMAKE_CXX_STANDARD
,CMAKE_CXX_STANDARD_REQUIRED
,etc.) when CMake is version 3.1 or above. Otherwise, if CMake is older
(e.g. Ubuntu 14.04) it falls back to using the -std=c++11 flag and
issues a warning.
This PR is based on the comment from @Yangqing:
#464 (comment)
The corresponding line in cmake/MiscCheck.cmake is removed in order to
reduce redundancy. Another option would be to move the C++11 logic to MiscCheck.cmake.