[Openmp-commits] [openmp] r348854 - [cmake] Use -std=gnu++11 to fix alloca() on NetBSD
Michal Gorny via Openmp-commits
openmp-commits at lists.llvm.org
Tue Dec 11 07:39:22 PST 2018
Author: mgorny
Date: Tue Dec 11 07:39:22 2018
New Revision: 348854
URL: http://llvm.org/viewvc/llvm-project?rev=348854&view=rev
Log:
[cmake] Use -std=gnu++11 to fix alloca() on NetBSD
Prefer using '-std=gnu++11' over '-std=c++11' when available, as NetBSD
exposes the correct alloca() implementation only with gnu* C/C++
standards.
Differential Revision: https://reviews.llvm.org/D55477
Modified:
openmp/trunk/cmake/HandleOpenMPOptions.cmake
openmp/trunk/cmake/config-ix.cmake
Modified: openmp/trunk/cmake/HandleOpenMPOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/cmake/HandleOpenMPOptions.cmake?rev=348854&r1=348853&r2=348854&view=diff
==============================================================================
--- openmp/trunk/cmake/HandleOpenMPOptions.cmake (original)
+++ openmp/trunk/cmake/HandleOpenMPOptions.cmake Tue Dec 11 07:39:22 2018
@@ -13,4 +13,7 @@ if (${OPENMP_ENABLE_WERROR})
append_if(OPENMP_HAVE_WERROR_FLAG "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()
-append_if(OPENMP_HAVE_STD_CPP11_FLAG "-std=c++11" CMAKE_CXX_FLAGS)
\ No newline at end of file
+append_if(OPENMP_HAVE_STD_GNUPP11_FLAG "-std=gnu++11" CMAKE_CXX_FLAGS)
+if (NOT OPENMP_HAVE_STD_GNUPP11_FLAG)
+ append_if(OPENMP_HAVE_STD_CPP11_FLAG "-std=c++11" CMAKE_CXX_FLAGS)
+endif()
Modified: openmp/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/cmake/config-ix.cmake?rev=348854&r1=348853&r2=348854&view=diff
==============================================================================
--- openmp/trunk/cmake/config-ix.cmake (original)
+++ openmp/trunk/cmake/config-ix.cmake Tue Dec 11 07:39:22 2018
@@ -3,4 +3,5 @@ include(CheckCXXCompilerFlag)
check_c_compiler_flag(-Werror OPENMP_HAVE_WERROR_FLAG)
-check_cxx_compiler_flag(-std=c++11 OPENMP_HAVE_STD_CPP11_FLAG)
\ No newline at end of file
+check_cxx_compiler_flag(-std=gnu++11 OPENMP_HAVE_STD_GNUPP11_FLAG)
+check_cxx_compiler_flag(-std=c++11 OPENMP_HAVE_STD_CPP11_FLAG)
More information about the Openmp-commits
mailing list