cmake check_cxx_compiler_flag() examples

apache/arrow cpp/cmake_modules/SetupCxxFlags.cmake :72

check_cxx_compiler_flag(${ARROW_AVX2_FLAG} CXX_SUPPORTS_AVX2)

apache/arrow cpp/cmake_modules/SetupCxxFlags.cmake :245

check_cxx_compiler_flag(-Wa,-mbig-obj CXX_SUPPORTS_BIG_OBJ)

assimp/assimp contrib/draco/cmake/draco_flags.cmake :98

# check_cxx_compiler_flag() requires that the flags are a string. When flags

google/benchmark cmake/AddCXXCompilerFlag.cmake :34

check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})

google/benchmark cmake/AddCXXCompilerFlag.cmake :51

check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})

google/benchmark test/AssemblyTests.cmake :25

check_cxx_compiler_flag(-O3 BENCHMARK_HAS_O3_FLAG)

ccache/ccache cmake/Utils.cmake :22

check_cxx_compiler_flag("${flag}" "${has_flag}")

CLIUtils/CLI11 cmake/CodeCoverage.cmake :173

check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :15

check_cxx_compiler_flag(-W                    LIBUNWIND_HAS_W_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :17

check_cxx_compiler_flag(-Wunused-variable     LIBUNWIND_HAS_WUNUSED_VARIABLE_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :21

check_cxx_compiler_flag(-Wwrite-strings       LIBUNWIND_HAS_WWRITE_STRINGS_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :22

check_cxx_compiler_flag(-Wchar-subscripts     LIBUNWIND_HAS_WCHAR_SUBSCRIPTS_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :24

check_cxx_compiler_flag(-Wmissing-braces      LIBUNWIND_HAS_WMISSING_BRACES_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :36

check_cxx_compiler_flag(/WX-                  LIBUNWIND_HAS_NO_WX_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :38

check_cxx_compiler_flag(/EHs-                 LIBUNWIND_HAS_NO_EHS_FLAG)

mono/corert src/Native/libunwind/cmake/config-ix.cmake :39

check_cxx_compiler_flag(/EHa-                 LIBUNWIND_HAS_NO_EHA_FLAG)

danmar/cppcheck cmake/compileroptions.cmake :5

check_cxx_compiler_flag(${FLAG} ${mangled_flag})

danmar/cppcheck cmake/compileroptions.cmake :93

check_cxx_compiler_flag("-mllvm -inline-deferral" _has_mllvm_inline_deferral)

cpputest/cpputest cmake/warnings.cmake :64

check_cxx_compiler_flag("${flag}" ${WARNING_CXX_FLAG_VAR})

marxin/cvise CMakeLists.txt :155

check_cxx_compiler_flag(
  "-Wclass-memaccess"
  SUPPORTS_CLASS_MEMACCESS
)

marxin/cvise CMakeLists.txt :160

check_cxx_compiler_flag(
  "-Wnon-template-friend"
  SUPPORTS_NON_TEMPLATE_FRIEND
)

google/draco cmake/draco_flags.cmake :103

check_cxx_compiler_flag("${all_cxx_flags_string}" draco_all_cxx_flags_pass)

google/draco cmake/draco_flags.cmake :127

# Since 3.17.0 check_cxx_compiler_flag() sets a normal variable at

google/draco cmake/draco_flags.cmake :136

check_cxx_compiler_flag("${cxx_flag}" cxx_flag_test_passed)

duckdb/duckdb CMakeLists.txt :659

# todo use CHECK_CXX_COMPILER_FLAG(-fsanitize=address SUPPORTS_SANITIZER) etc.

Exiv2/exiv2 cmake/compilerFlags.cmake :40

check_cxx_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG)

libfann/fann tests/CMakeLists.txt :10

CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)

xiph/flac CMakeLists.txt :166

check_cxx_compiler_flag(-Weffc++ HAVE_WEFFCXX_FLAG)

FluidSynth/fluidsynth cmake_admin/CodeCoverage.cmake :161

check_cxx_compiler_flag(-fprofile-abs-path HAVE_fprofile_abs_path)

facebook/folly CMake/FollyConfigChecks.cmake :45

check_cxx_compiler_flag(
  -Wshadow-compatible-local
  COMPILER_HAS_W_SHADOW_COMPATIBLE_LOCAL)

facebook/folly CMake/FollyConfigChecks.cmake :65

check_cxx_compiler_flag(
    -Winconsistent-missing-override
    COMPILER_HAS_W_INCONSISTENT_MISSING_OVERRIDE)

fontforge/fontforge cmake/TargetUtils.cmake :96

check_cxx_compiler_flag("-Werror ${_arg}" _supported_flag)

FreeCAD/FreeCAD src/3rdParty/lru-cache/CMakeLists.txt :18

# check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX_17)

FreeCAD/FreeCAD src/3rdParty/salomesmesh/CMakeLists.txt :29

check_cxx_compiler_flag("-Wno-maybe-uninitialized" _flag_found)

FreeCAD/FreeCAD src/3rdParty/salomesmesh/CMakeLists.txt :46

check_cxx_compiler_flag("-Wno-deprecated-copy" _flag_found)

FreeCAD/FreeCAD src/3rdParty/salomesmesh/CMakeLists.txt :58

check_cxx_compiler_flag("-Wno-c++17-extensions" _flag_found)

FreeRDP/FreeRDP cmake/CXXCompilerFlags.cmake :5

check_cxx_compiler_flag("${FLAG}" CXXFLAG${FLAG})

KDAB/GammaRay 3rdparty/kuserfeedback/CMakeLists.txt :34

check_cxx_compiler_flag(-Wno-unneeded-internal-declaration HAVE_NO_CXX_UNNEEDED_INTERNAL_DEC)

OSGeo/gdal cmake/helpers/GdalCompilationFlags.cmake :69

check_cxx_compiler_flag(-W${flag_name} "HAVE_WFLAG_${flag_name_upper}")

OSGeo/gdal cmake/helpers/GdalCompilationFlags.cmake :175

check_cxx_compiler_flag(-fno-fast-math HAVE_FLAG_NO_FAST_MATH)

gnuradio/gnuradio CMakeLists.txt :386

check_cxx_compiler_flag(-fcx-limited-range HAVE_CX_LIMITED_RANGE)

Microsoft/GSL tests/CMakeLists.txt :265

check_cxx_compiler_flag("-Wno-reserved-identifier" WARN_RESERVED_ID)

harfbuzz/harfbuzz CMakeLists.txt :558

CHECK_CXX_COMPILER_FLAG(-Bsymbolic-functions CXX_SUPPORTS_FLAG_BSYMB_FUNCS)

InsightSoftwareConsortium/ITK CMake/ITKSetStandardCompilerFlags.cmake :53

check_cxx_compiler_flag(${flag} CXX_HAS_WARNING${flag_var})

KDAB/KDStateMachineEditor CMakeLists.txt :308

check_cxx_compiler_flag(-std=gnu++0x HAVE_GXX_GNUXX11)

KDAB/KDStateMachineEditor CMakeLists.txt :309

check_cxx_compiler_flag(-std=c++0x HAVE_GXX_CXX11)

keepassxreboot/keepassxc CMakeLists.txt :258

check_cxx_compiler_flag("${FLAG}" CXX_HAS${FLAGNAME})

KhronosGroup/KTX external/fmt/test/CMakeLists.txt :159

check_cxx_compiler_flag(-fno-exceptions HAVE_FNO_EXCEPTIONS_FLAG)

lammps/lammps cmake/Modules/Testing.cmake :31

check_cxx_compiler_flag(-fuse-ld=gold HAVE_GOLD_LINKER_FLAG)

lammps/lammps cmake/Modules/Packages/INTEL.cmake :88

check_cxx_compiler_flag("${_FLAG}" COMPILER_SUPPORTS${_FLAGX})

lammps/lammps lib/kokkos/cmake/kokkos_arch.cmake :349

check_cxx_compiler_flag("-tp=grace" COMPILER_SUPPORTS_GRACE_AS_TARGET_PROCESSOR)

lammps/lammps lib/kokkos/cmake/kokkos_arch.cmake :352

check_cxx_compiler_flag("-msve-vector-bits=128" COMPILER_SUPPORTS_SVE_VECTOR_BITS)

google/leveldb CMakeLists.txt :83

check_cxx_compiler_flag(-Wthread-safety HAVE_CLANG_THREAD_SAFETY)

libical/libical cmake/modules/LibIcalMacrosInternal.cmake :54

check_cxx_compiler_flag(
  "${flag}"
  "CXX_SUPPORTS_${name}"
)

libjxl/libjxl CMakeLists.txt :20

check_cxx_compiler_flag("-fsanitize=fuzzer-no-link" CXX_FUZZERS_SUPPORTED)

libjxl/libjxl CMakeLists.txt :21

check_cxx_compiler_flag("-fmacro-prefix-map=OLD=NEW" CXX_MACRO_PREFIX_MAP)

libjxl/libjxl CMakeLists.txt :23

check_cxx_compiler_flag("-mavx2" CXX_MAVX2_SUPPORTED)

libjxl/libjxl CMakeLists.txt :24

check_cxx_compiler_flag("-mf16c" CXX_MF16C_SUPPORTED)

libjxl/libjxl CMakeLists.txt :27

check_cxx_compiler_flag("-mavx512cd" CXX_MAVX512CD_SUPPORTED)

webmproject/libwebm build/cxx_flags.cmake :48

check_cxx_compiler_flag("${cxx_flag}" LIBWEBM_HAVE_CXX_FLAG)

rui314/mold third-party/zstd/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake :25

CHECK_CXX_COMPILER_FLAG(${_flag} CXX_FLAG_${varname})

nanodbc/nanodbc CMakeLists.txt :38

check_cxx_compiler_flag( "-stdlib=libc++" CXX_COMPILER_SUPPORTS_LIBCXX )

YosysHQ/nextpnr 3rdparty/QtPropertyBrowser/cmake/CompileSettings.cmake :37

CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)

ngtcp2/nghttp3 cmake/PickyWarningsCXX.cmake :121

check_cxx_compiler_flag(${_CCOPT_ON} ${_optvarname})

ollama/ollama ml/backend/ggml/ggml/src/ggml-cpu/CMakeLists.txt :95

check_cxx_compiler_flag(-mfp16-format=ieee GGML_COMPILER_SUPPORTS_FP16_FORMAT_I3E)

BYVoid/OpenCC deps/google-benchmark/test/AssemblyTests.cmake :35

check_cxx_compiler_flag(-fno-stack-protector BENCHMARK_HAS_FNO_STACK_PROTECTOR_FLAG)

BYVoid/OpenCC deps/google-benchmark/test/CMakeLists.txt :117

check_cxx_compiler_flag(-O3 BENCHMARK_HAS_O3_FLAG)

BYVoid/OpenCC deps/pybind11-2.13.1/tools/pybind11Common.cmake :297

check_cxx_compiler_flag("${cxxflags}" ${result})

AcademySoftwareFoundation/OpenColorIO share/cmake/utils/CheckSupportSSE2.cmake :22

check_cxx_compiler_flag("/arch:SSE2" COMPILER_SUPPORTS_SSE2)

AcademySoftwareFoundation/OpenColorIO share/cmake/utils/CppVersion.cmake :50

CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++14" COMPILER_SUPPORTS_CXX14)

YosysHQ/prjtrellis libtrellis/3rdparty/pybind11/tools/pybind11Common.cmake :268

check_cxx_compiler_flag("${cxxflags}" ${result})

qbittorrent/qBittorrent cmake/Modules/CommonConfig.cmake :67

check_cxx_compiler_flag(-Wstrict-null-sentinel SNS_SUPPORT)

ossia/score cmake/ScoreConfiguration.cmake :141

check_cxx_compiler_flag(-Wno-gnu-anonymous-struct has_w_gnu_anonymous_struct_flag)

ossia/score cmake/ScoreConfiguration.cmake :143

check_cxx_compiler_flag(-Wno-dtor-name has_w_dtor_name_flag)

ossia/score cmake/ScoreConfiguration.cmake :257

check_cxx_compiler_flag("-Werror -Wextra -Wall -mcx16" has_mcx16_flag)

ossia/score cmake/ScoreExternalAddon.developer.cmake :175

check_cxx_compiler_flag(-std=c++2a has_std_2a_flag)

ossia/score cmake/ScoreExternalAddon.developer.cmake :177

check_cxx_compiler_flag(-std=c++1z has_std_1z_flag)

google/shaderc CMakeLists.txt :89

check_cxx_compiler_flag(-Wextra-semi COMPILER_SUPPORTS_EXTRA_SEMI_WARNING)

google/shaderc third_party/CMakeLists.txt :38

check_cxx_compiler_flag(-fPIC COMPILER_SUPPORTS_PIC)

simdjson/simdjson CMakeLists.txt :126

check_cxx_compiler_flag(-mlsx COMPILER_SUPPORTS_LSX)

MesserLab/SLiM CMakeLists.txt :230

CHECK_CXX_COMPILER_FLAG(-flto CXX_SUPPORTS_FLTO)

google/snappy CMakeLists.txt :126

CHECK_CXX_COMPILER_FLAG("-mbmi2" HAVE_CLANG_MBMI2)

pothosware/SoapyRTLSDR CMakeLists.txt :35

CHECK_CXX_COMPILER_FLAG("-std=c++11" HAS_STD_CXX11)

ThePhD/sol2 cmake/Modules/CheckCompilerFlag.cmake :55

check_cxx_compiler_flag(${flag_CLANG} CXX_CHECK_FLAG_${suffix})

stxxl/stxxl CMakeLists.txt :214

check_cxx_compiler_flag(-Wextra CXX_HAS_FLAGS_WEXTRA)

LLNL/sundials cmake/SundialsSetupCuda.cmake :50

check_cxx_compiler_flag(-mno-float128 _hasflag)

apple/swift cmake/modules/SwiftSharedCMakeConfig.cmake :273

check_cxx_compiler_flag("-Werror=switch" CXX_SUPPORTS_WERROR_SWITCH_FLAG)

apple/swift cmake/modules/SwiftSharedCMakeConfig.cmake :286

check_cxx_compiler_flag("-Werror -Wimplicit-fallthrough" CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG)

apple/swift cmake/modules/SwiftSharedCMakeConfig.cmake :298

check_cxx_compiler_flag("-Werror -Woverloaded-virtual" CXX_SUPPORTS_OVERLOADED_VIRTUAL)

apple/swift cmake/modules/SwiftSharedCMakeConfig.cmake :303

check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)

apple/swift stdlib/public/CMakeLists.txt :54

check_cxx_compiler_flag("-Wformat-nonliteral -Werror=format-nonliteral" CXX_SUPPORTS_FORMAT_NONLITERAL_WARNING)

apple/swift stdlib/toolchain/CMakeLists.txt :27

check_cxx_compiler_flag("${flag}" cxx_compiler_flag_${flag}_is_supported)

apache/thrift build/cmake/DefinePlatformSpecifc.cmake :41

check_cxx_compiler_flag("/execution-charset:utf-8" res_var)

ToruNiina/toml11 CMakeLists.txt :48

check_cxx_compiler_flag("-Wextra"               TOML11_COMPILER_SUPPORTS_WEXTRA)

ToruNiina/toml11 CMakeLists.txt :49

check_cxx_compiler_flag("-Wpedantic"            TOML11_COMPILER_SUPPORTS_WPEDANTIC)

ToruNiina/toml11 CMakeLists.txt :59

check_cxx_compiler_flag("-Wshadow"              TOML11_COMPILER_SUPPORTS_WSHADOW)

trilinos/Trilinos packages/kokkos/cmake/kokkos_arch.cmake :353

check_cxx_compiler_flag("-mcpu=neoverse-n2" COMPILER_SUPPORTS_NEOVERSE_N2)

vrpn/vrpn cmake/EnableExtraCompilerWarnings.cmake :38

check_cxx_compiler_flag(-W SUPPORTS_W_FLAG)

Z3Prover/z3 CMakeLists.txt :284

CHECK_CXX_COMPILER_FLAG("${SSE_FLAGS}" HAS_SSE2)

Z3Prover/z3 cmake/msvc_legacy_quirks.cmake :76

CHECK_CXX_COMPILER_FLAG(${NO_OMIT_FRAME_POINTER_MSVC_FLAG} HAS_MSVC_NO_OMIT_FRAME_POINTER)