Revert "[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision...
[lldb.git] / openmp / cmake / HandleOpenMPOptions.cmake
1 if (OPENMP_STANDALONE_BUILD)
2   # From HandleLLVMOptions.cmake
3   function(append_if condition value)
4     if (${condition})
5       foreach(variable ${ARGN})
6         set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
7       endforeach(variable)
8     endif()
9   endfunction()
10 endif()
11
12 # MSVC and clang-cl in compatibility mode map -Wall to -Weverything.
13 # TODO: LLVM adds /W4 instead, check if that works for the OpenMP runtimes.
14 if (NOT MSVC)
15   append_if(OPENMP_HAVE_WALL_FLAG "-Wall" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
16 endif()
17 if (OPENMP_ENABLE_WERROR)
18   append_if(OPENMP_HAVE_WERROR_FLAG "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
19 endif()
20
21 # Additional warnings that are not enabled by -Wall.
22 append_if(OPENMP_HAVE_WCAST_QUAL_FLAG "-Wcast-qual" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
23 append_if(OPENMP_HAVE_WFORMAT_PEDANTIC_FLAG "-Wformat-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
24 append_if(OPENMP_HAVE_WIMPLICIT_FALLTHROUGH_FLAG "-Wimplicit-fallthrough" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
25 append_if(OPENMP_HAVE_WSIGN_COMPARE_FLAG "-Wsign-compare" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
26
27 # Warnings that we want to disable because they are too verbose or fragile.
28 append_if(OPENMP_HAVE_WNO_EXTRA_FLAG "-Wno-extra" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
29 append_if(OPENMP_HAVE_WNO_PEDANTIC_FLAG "-Wno-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
30 append_if(OPENMP_HAVE_WNO_MAYBE_UNINITIALIZED_FLAG "-Wno-maybe-uninitialized" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
31
32 append_if(OPENMP_HAVE_STD_GNUPP14_FLAG "-std=gnu++14" CMAKE_CXX_FLAGS)
33 if (NOT OPENMP_HAVE_STD_GNUPP14_FLAG)
34   append_if(OPENMP_HAVE_STD_CPP14_FLAG "-std=c++14" CMAKE_CXX_FLAGS)
35 endif()