cmake add_compile_options() examples

assimp/assimp CMakeLists.txt :320

ADD_COMPILE_OPTIONS("$<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference>")

BinomialLLC/basis_universal CMakeLists.txt :19

add_compile_options(/W4)

KimuraRyo/BSDFProcessor CMakeLists.txt :57

add_compile_options(/W4)

USCiLab/cereal CMakeLists.txt :40

add_compile_options(/bigobj /W3 /WX)

projectchrono/chrono src/chrono_thirdparty/yaml-cpp/test/googletest-1.13.0/googlemock/CMakeLists.txt :140

add_compile_options("-Wa,-mbig-obj")

mono/corefx cross/arm64/toolchain.cmake :10

add_compile_options(--sysroot=${CROSS_ROOTFS})

mono/corefx src/Native/Unix/CMakeLists.txt :30

add_compile_options(-Wno-unreachable-code)

mono/corefx src/Native/Unix/CMakeLists.txt :114

add_compile_options(-fstack-protector)

mono/corefx src/Native/Windows/CMakeLists.txt :39

add_compile_options(/EHa)         # enable C++ EH (w/ SEH exceptions)

mono/corefx src/Native/Windows/CMakeLists.txt :48

add_compile_options(/Zm200)       # Specify Precompiled Header Memory Allocation Limit of 150MB

mono/corert src/Native/CMakeLists.txt :192

add_compile_options(-g -O0)

mono/corert src/Native/Runtime/CMakeLists.txt :181

add_compile_options($<$<CONFIG:Debug>:-DFEATURE_GC_STRESS>)

mono/corert src/Native/Runtime/CMakeLists.txt :213

add_compile_options(-Wno-unused-variable)

mono/corert src/Native/Runtime/CMakeLists.txt :215

add_compile_options(-Qunused-arguments)

cp2k/cp2k cmake/CompilerConfiguration.cmake :37

add_compile_options(
  "$<$<COMPILE_LANG_AND_ID:C,GNU>:-march=native;-mtune=native>"
  "$<$<COMPILE_LANG_AND_ID:Fortran,GNU>:-march=native;-mtune=native;-fbacktrace;-ffree-line-length-none;-ffree-form;-std=f2008;-fimplicit-none;-Werror=aliasing;-Werror=ampersand;-Werror=c-binding-type;-Werror=conversion;-Werror=intrinsic-shadow;-Werror=intrinsics-std;-Werror=line-truncation;-Werror=tabs;-Werror=target-lifetime;-Werror=underflow;-Werror=unused-but-set-variable;-Werror=unused-variable>"
  "$<$<AND:$<COMPILE_LANG_AND_ID:Fortran,GNU>,$<VERSION_GREATER_EQUAL:${CMAKE_Fortran_COMPILER_VERSION},11>>:-fallow-argument-mismatch>"
  "$<$<COMPILE_LANG_AND_ID:Fortran,Intel>:-free -stand=f18 -fpp -heap-arrays>"
  "$<$<COMPILE_LANG_AND_ID:Fortran,PGI>:-Mfreeform -Mextend -Mallocatable=03>"
  "$<$<COMPILE_LANG_AND_ID:Fortran,NAG>:-f2008 -free -Warn=reallocation -Warn=subnormal>"
  "$<$<COMPILE_LANG_AND_ID:C,Cray>:-hnoacc -h nomessage=1234>"
  "$<$<COMPILE_LANG_AND_ID:Fortran,Cray>:-f free -M3105 -ME7212  -hnoacc -M1234>"
)

danmar/cppcheck cmake/compileroptions.cmake :37

add_compile_options(-Werror)

danmar/cppcheck cmake/compileroptions.cmake :46

add_compile_options(-Wfloat-equal)              # Floating values used in equality comparisons

danmar/cppcheck cmake/compileroptions.cmake :59

#add_compile_options(-Wlogical-op) # doesn't work on older GCC

danmar/cppcheck cmake/compileroptions.cmake :65

add_compile_options(-pipe)

danmar/cppcheck cmake/compileroptions.cmake :100

add_compile_options(-gdwarf-4)

danmar/cppcheck cmake/compileroptions.cmake :124

add_compile_options(-Wno-sign-compare)

danmar/cppcheck cmake/compileroptions.cmake :136

add_compile_options(-Wno-c++98-compat-pedantic)

danmar/cppcheck cmake/compileroptions.cmake :158

add_compile_options(/W4) # Warning Level

danmar/cppcheck cmake/compileroptions.cmake :183

add_compile_options($<$<CONFIG:Debug>:/GS>) # Enable Security Check

danmar/cppcheck cmake/compileroptions.cmake :197

add_compile_options(/wd4251) # warning C4251: 'x': class 'y' needs to have dll-interface to be used by clients of struct 'u'

danmar/cppcheck cmake/dynamic_analyzer_options.cmake :26

add_compile_options(-fno-sanitize-recover=all)

LinuxDevon/dbc_parser_cpp CMakeLists.txt :72

add_compile_options(/W4 /WX)

LinuxDevon/dbc_parser_cpp test/CMakeLists.txt :17

add_compile_options(/W4 /WX)

davisking/dlib dlib/test/CMakeLists.txt :188

add_compile_options(-Wno-free-nonheap-object)

davisking/dlib dlib/test/CMakeLists.txt :199

add_compile_options(-Wno-alloc-size-larger-than)

Exiv2/exiv2 cmake/compilerFlags.cmake :53

add_compile_options(-D_GLIBCXX_ASSERTIONS)

FluidSynth/fluidsynth CMakeLists.txt :352

add_compile_options ( -mms-bitfields )

FreeCAD/FreeCAD src/Mod/Fem/App/CMakeLists.txt :6

add_compile_options(-Wno-inconsistent-missing-override)

FreeCAD/FreeCAD src/Mod/Fem/Gui/CMakeLists.txt :3

add_compile_options(-Wno-pedantic) # needed for vtk headers

KhronosGroup/glslang CMakeLists.txt :191

add_compile_options(-Werror)

KhronosGroup/glslang CMakeLists.txt :199

add_compile_options(/Os /GR-)

KhronosGroup/glslang CMakeLists.txt :204

add_compile_options(-Wno-unused-variable -Wno-unused-const-variable)

gnuradio/gnuradio cmake/Modules/GrCompilerSettings.cmake :108

add_compile_options(/MP) #build with multiple processors

HDFGroup/hdf5 config/cmake/ZLIBNG/CMakeLists.txt :381

add_compile_options(${WARNFLAGS} ${WARNFLAGS_MAINTAINER} ${WARNFLAGS_DISABLE})

HDFGroup/hdf5 config/cmake/ZLIBNG/CMakeLists.txt :599

add_compile_options($<$<CONFIG:Debug>:-DZLIB_DEBUG>)

berndporr/iir1 CMakeLists.txt :35

add_compile_options(/W4)

berndporr/iir1 demo/CMakeLists.txt :6

add_compile_options(/W4)

berndporr/iir1 test/CMakeLists.txt :4

add_compile_options(/W4)

keepassxreboot/keepassxc CMakeLists.txt :400

add_compile_options(/Zf)

keepassxreboot/keepassxc utils/vcpkg_ports/argon2/CMakeLists.txt :7

add_compile_options(/W3)

KhronosGroup/KTX CMakeLists.txt :301

add_compile_options( /W4;$<$<BOOL:${KTX_WERROR}>:/WX> )

KhronosGroup/KTX CMakeLists.txt :305

add_compile_options( $<$<CXX_COMPILER_ID:MSVC>:/utf-8> )

KhronosGroup/KTX external/astc-encoder/CMakeLists.txt :25

add_compile_options("/wd4324")

lammps/lammps examples/plugins/CMakeLists.txt :37

add_compile_options(/wd4267)

lammps/lammps tools/lammps-gui/CMakeLists.txt :87

add_compile_options(/wd4267)

lammps/lammps tools/lammps-gui/CMakeLists.txt :89

add_compile_options(/EHsc)

lammps/lammps tools/phonon/CMakeLists.txt :29

add_compile_options(/wd5045)

DanBloomberg/leptonica CMakeLists.txt :231

add_compile_options("$<$<CONFIG:Debug>:/W4;/DDEBUG>")

arvidn/libtorrent CMakeLists.txt :492

add_compile_options(
	-Weverything
	-Wno-c++98-compat-pedantic
	-Wno-c++11-compat-pedantic
	-Wno-padded
	-Wno-alloca
	-Wno-global-constructors
	-Wno-exit-time-destructors
	-Wno-weak-vtables
	-Wno-return-std-move-in-c++11
	-Wno-unsafe-buffer-usage
	-Wno-unknown-warning-option
	-Wno-switch-default
)

arvidn/libtorrent CMakeLists.txt :517

add_compile_options(
	/W4
	# C4251: 'identifier' : class 'type' needs to have dll-interface to be
	#        used by clients of class 'type2'
	/wd4251
	# C4268: 'identifier' : 'const' static/global data initialized
	#        with compiler generated default constructor fills the object with zeros
	/wd4268
	# C4275: non DLL-interface classkey 'identifier' used as base for
	#        DLL-interface classkey 'identifier'
	/wd4275
	# C4373: virtual function overrides, previous versions of the compiler
	#        did not override when parameters only differed by const/volatile qualifiers
	/wd4373
	# C4503: 'identifier': decorated name length exceeded, name was truncated
	/wd4503
)

google/libultrahdr CMakeLists.txt :303

add_compile_options(-march=armv7-a)

google/libultrahdr CMakeLists.txt :306

add_compile_options(-mfloat-abi=hard)

bittorrent/libutp CMakeLists.txt :33

add_compile_options(
    -Wall
    -Wextra
    -pedantic
    $<$<BOOL:${LIBUTP_ENABLE_WERROR}>:-Werror>)

bittorrent/libutp CMakeLists.txt :39

add_compile_options(
    /W4
    /wd4244 # '...': conversion from '...' to '...', possible loss of data
    /wd4267 # '...': conversion from '...' to '...', possible loss of data
    $<$<BOOL:${LIBUTP_ENABLE_WERROR}>:/WX>)

litehtml/litehtml CMakeLists.txt :159

add_compile_options(/W4)

schrodinger/maeparser CMakeLists.txt :19

add_compile_options(/WX)

zeux/meshoptimizer CMakeLists.txt :70

add_compile_options(/W4)

rui314/mold third-party/tbb/cmake/compilers/MSVC.cmake :81

add_compile_options(
    "$<$<COMPILE_LANGUAGE:CXX>:/d1trimfile:${NATIVE_TBB_PROJECT_ROOT_DIR}\\>"
    "$<$<COMPILE_LANGUAGE:CXX>:/d1trimfile:${CMAKE_SOURCE_DIR}/>")

wjakob/nanobind tests/CMakeLists.txt :24

add_compile_options(/W4)

dankamongmen/notcurses CMakeLists.txt :136

add_compile_options(/W4)

dankamongmen/notcurses CMakeLists.txt :142

add_compile_options(-fexceptions -fstrict-aliasing)

ollama/ollama ml/backend/ggml/ggml/src/CMakeLists.txt :18

add_compile_options(-fsanitize=address -fno-omit-frame-pointer)

ollama/ollama ml/backend/ggml/ggml/src/CMakeLists.txt :33

add_compile_options(/WX)

BYVoid/OpenCC deps/googletest-1.15.0/googlemock/CMakeLists.txt :135

add_compile_options("-Wa,-mbig-obj")

opencv/opencv 3rdparty/zlib-ng/cmake/detect-sanitizer.cmake :153

add_compile_options(-fsanitize=${supported_checks})

opencv/opencv 3rdparty/zlib-ng/cmake/detect-sanitizer.cmake :159

add_compile_options(-fno-sanitize=alignment)

AcademySoftwareFoundation/OpenImageIO src/cmake/compiler.cmake :152

add_compile_options ("-Wno-overloaded-virtual")

AcademySoftwareFoundation/OpenImageIO src/cmake/compiler.cmake :175

add_compile_options ("-Wno-unused-local-typedefs")

AcademySoftwareFoundation/OpenImageIO src/cmake/compiler.cmake :185

add_compile_options ("-Wno-overriding-t-option")

AcademySoftwareFoundation/OpenImageIO src/cmake/compiler.cmake :212

add_compile_options ("/fp:fast")

AcademySoftwareFoundation/OpenImageIO src/cmake/compiler.cmake :218

add_compile_options ("-fno-fast-math")

AcademySoftwareFoundation/OpenImageIO src/cmake/compiler.cmake :343

add_compile_options ("-ffp-contract=off")

AcademySoftwareFoundation/OpenShadingLanguage CMakeLists.txt :244

add_compile_options("-fno-reciprocal-math")

AcademySoftwareFoundation/OpenShadingLanguage src/cmake/compiler.cmake :195

add_compile_options ("-fno-math-errno")

AcademySoftwareFoundation/OpenShadingLanguage src/cmake/compiler.cmake :200

add_compile_options ("-Wno-overriding-t-option")

AcademySoftwareFoundation/OpenShadingLanguage src/cmake/compiler.cmake :314

add_compile_options ("-ffp-contract=off")

AcademySoftwareFoundation/openvdb cmake/config/OpenVDBCXX.cmake :135

add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Zc:inline>")

AcademySoftwareFoundation/openvdb cmake/config/OpenVDBCXX.cmake :182

add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,Clang,AppleClang>:-Wover-aligned>")

podofo/podofo CMakeLists.txt :128

add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/std:c++17> $<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus> /permissive- /utf-8 /we4287 /W4)

OSGeo/PROJ src/CMakeLists.txt :2

add_compile_options("$<$<COMPILE_LANGUAGE:C>:${PROJ_C_WARN_FLAGS}>")

qgis/QGIS external/PDF4QT/CMakeLists.txt :84

add_compile_options(/bigobj /W4 /wd5054 /wd4127 /wd4702)

nitroshare/qmdnsengine CMakeLists.txt :49

add_compile_options(/W4)

qtwebkit/qtwebkit Source/cmake/OptionsMSVC.cmake :21

add_compile_options(/analyze- /bigobj)

qtwebkit/qtwebkit Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/CMakeLists.txt :108

add_compile_options(-pedantic-errors)

qtwebkit/qtwebkit Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/CMakeLists.txt :119

add_compile_options($<$<CONFIG:Debug>:/W4>)

qtwebkit/qtwebkit Source/ThirdParty/libwebrtc/Source/third_party/jsoncpp/source/CMakeLists.txt :131

add_compile_options(-pedantic)

lballabio/QuantLib CMakeLists.txt :99

add_compile_options(-W3)

ra3xdh/qucs_s qucs-activefilter/CMakeLists.txt :58

add_compile_options(/wd4244 /wd4267 /wd4312)

ra3xdh/qucs_s qucs-activefilter/CMakeLists.txt :62

add_compile_options(-Wno-ignored-attributes)

ra3xdh/qucs_s qucs-activefilter/CMakeLists.txt :69

add_compile_options(/permissive- /Zc:__cplusplus /Zc:preprocessor /MP /vmg)

ra3xdh/qucs_s qucs-powercombining/CMakeLists.txt :60

add_compile_options(-Wall -Wextra -O0 -g)

ra3xdh/qucs_s qucs-transcalc/CMakeLists.txt :56

add_compile_options(/permissive- /Zc:__cplusplus /Zc:preprocessor /MP /Od /vmg)

rapidfuzz/rapidfuzz CMakeLists.txt :31

add_compile_options(/W4 /bigobj /wd4127)

merbanan/rtl_433 CMakeLists.txt :117

add_compile_options("/wd4305")

fnc12/sqlite_orm CMakeLists.txt :75

add_compile_options(/bigobj)