From: Ebrahim Byagowi Date: Sun, 30 Dec 2018 06:53:47 +0000 (+0330) Subject: [cmake] Enable C++11 on CMake (#1519) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5989e0962309b27b2486d8fd20f3cbc05c3d79a;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [cmake] Enable C++11 on CMake (#1519) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b6241e9..6a1a36d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -552,7 +552,7 @@ endif () if (UNIX OR MINGW) # Make symbols link locally include (CheckCXXCompilerFlag) - check_cxx_compiler_flag(-Bsymbolic-functions CXX_SUPPORTS_FLAG_BSYMB_FUNCS) + CHECK_CXX_COMPILER_FLAG(-Bsymbolic-functions CXX_SUPPORTS_FLAG_BSYMB_FUNCS) if (CXX_SUPPORTS_FLAG_BSYMB_FUNCS) link_libraries(-Bsymbolic-functions) endif () @@ -570,8 +570,16 @@ if (UNIX OR MINGW) # No threadsafe statics as we do it ourselves set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics") endif () + + CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) + if (COMPILER_SUPPORTS_CXX11) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + endif() endif () + ## Define harfbuzz-gobject library if (HB_HAVE_GOBJECT) add_library(harfbuzz-gobject