mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-01 11:52:54 +01:00
Improve project C++17 support (#4334)
Poco now use C++17. We can take some old code away because of that. We also raise requiments for C++17 so everything works as excpected with it. Co-authored-by: Kari Argillander <kari.argillander@fidelix.com>
This commit is contained in:
@@ -18,31 +18,6 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# Determines whether the compiler supports C++11
|
||||
macro(check_for_cxx11_compiler _VAR)
|
||||
message(STATUS "Checking for C++11 compiler ...")
|
||||
set(${_VAR})
|
||||
try_compile(_COMPILER_TEST_RESULT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/test_compiler.cpp CMAKE_FLAGS -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
|
||||
if(NOT _COMPILER_TEST_RESULT AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
try_compile(_COMPILER_TEST_RESULT ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/cmake/test_compiler.cpp CMAKE_FLAGS -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DCMAKE_CXX_STANDARD=11 -DCMAKE_CXX_STANDARD_REQUIRED=ON)
|
||||
if(_COMPILER_TEST_RESULT)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
else()
|
||||
message(STATUS "To enable C++11 install libc++ standard library from https://libcxx.llvm.org/")
|
||||
endif()
|
||||
endif()
|
||||
if(_COMPILER_TEST_RESULT AND ((MSVC AND (MSVC10 OR MSVC11 OR MSVC12 OR MSVC14)) OR
|
||||
(CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.1) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "QCC" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.1) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.3) OR
|
||||
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")))
|
||||
set(${_VAR} 1)
|
||||
message(STATUS "Checking for C++11 compiler - available")
|
||||
else()
|
||||
message(STATUS "Checking for C++11 compiler - unavailable")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Determines whether the compiler supports C++17
|
||||
macro(check_for_cxx17_compiler _VAR)
|
||||
message(STATUS "Checking for C++17 compiler")
|
||||
|
||||
Reference in New Issue
Block a user