target_compile_options(<target> [BEFORE] <INTERFACE|PUBLIC|PRIVATE> [items1...] [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
target_compile_options(<target> [BEFORE] <INTERFACE|PUBLIC|PRIVATE> [items1...] [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
target_compile_options(${WB_TARGET} INTERFACE ${WB_COMPILER_OPTIONS_INTERFACE} PRIVATE ${WB_COMPILER_OPTIONS_PRIVATE} ${WB_COMPILER_OPTIONS_PRIVATE_COVERAGE_NEW})
target_compile_options(${dest_target} INTERFACE $<GENEX_EVAL:$<TARGET_PROPERTY:${source_target_de_alias},INTERFACE_COMPILE_OPTIONS>>)
target_compile_options(sdl-build-options INTERFACE "-fobjc-arc")
target_compile_options(${ra_engine_target} PRIVATE PUBLIC ${DEFAULT_COMPILE_OPTIONS} INTERFACE)
target_compile_options(${target}
PRIVATE /interface /ifcOutput ${BMI}
INTERFACE /reference fmt=${BMI})
target_compile_options(ramses-build-options-base INTERFACE -Wno-implicit-fallthrough)
target_compile_options(${target}
PRIVATE /interface /ifcOutput ${BMI}
INTERFACE /reference fmt=${BMI})
target_compile_options(alpaka INTERFACE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler /wd4505>")
target_compile_options(csharp_warnings INTERFACE "$<${is_gnu_or_clang_genex}:-Wno-deprecated-declarations>")
target_compile_options(${PROJECT_NAME}_headers INTERFACE ${PUBLIC_OPTIONS})
target_compile_options(igl_common INTERFACE "/MD$<$<CONFIG:Debug>:d>")
target_compile_options(MtKaHyPar-BuildFlags INTERFACE -fprofile-arcs -ftest-coverage -fprofile-update=atomic)
target_compile_options("${TARGET_NAME}"
INTERFACE "$<BUILD_INTERFACE:${lang_flags_if_has_secret_prop}>"
)
target_compile_options(${TARGET_NAME} INTERFACE
-Wno-unused-function
-Wno-unused-variable
-Wno-unused-parameter
-Wno-unused-local-typedefs)
target_compile_options(score_lib_base INTERFACE
"SHELL:-Xclang -internal-isystem -Xclang ${SCORE_SDK}/include/x86_64-unknown-linux-gnu/c++/v1"
)
target_compile_options(matx INTERFACE ${OpenMP_CXX_FLAGS})
target_compile_options(paraviewbuild
INTERFACE
"$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:${lang}>:${flag}>>")
target_compile_options(${library} INTERFACE -mcpu=apple-m1)
target_compile_options(ghc_filesystem INTERFACE "$<$<C_COMPILER_ID:MSVC>:/utf-8>")
target_compile_options(
${PROJECT_CUDA_INTERFACE_PREFIX}-cuda
INTERFACE
$<$<COMPILE_LANGUAGE:CUDA>:$<$<CUDA_COMPILER_ID:NVIDIA>:--expt-extended-lambda>>
)
target_compile_options(${target_name}
PUBLIC ${COMPILE_OPTIONS_PUBLIC}
PRIVATE ${COMPILE_OPTIONS_PRIVATE}
INTERFACE ${COMPILE_OPTIONS_INTERFACE}
${ARG_COMPILE_OPTIONS})
target_compile_options(pasta_cxx_settings INTERFACE ${CXX_WARNING_OPTIONS})
target_compile_options(nanovdb INTERFACE
"$<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:-arch=sm_75>")
target_compile_options(Catch2WithMain INTERFACE -Wno-error=parentheses)
target_compile_options(
hpx_pkgconfig_application INTERFACE "-std=c++${HPX_CXX_STANDARD}"
)
target_compile_options(SimTKcommon INTERFACE
"$<$<AND:$<CXX_COMPILER_ID:MSVC>,$<CONFIG:Debug>>:/wd4996>")
target_compile_options(
CLI11_warnings
INTERFACE $<$<BOOL:${CLI11_FORCE_LIBCXX}>:-stdlib=libc++>
$<$<CXX_COMPILER_ID:MSVC>:/W4
$<$<BOOL:${CLI11_WARNINGS_AS_ERRORS}>:/WX>>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:${unix-warnings}
$<$<BOOL:${CLI11_WARNINGS_AS_ERRORS}>:-Werror>>)
target_compile_options(dawn_warnings_config
INTERFACE
"$<BUILD_INTERFACE:$<$<COMPILE_LANGUAGE:${lang}>:${flag}>>"
)
target_compile_options(project_options INTERFACE /nologo)
target_compile_options(Juce::core INTERFACE -x objective-c++)
target_compile_options ( lextra INTERFACE -g -fsanitize=address,fuzzer )
target_compile_options(glaze_glaze INTERFACE "/Zc:preprocessor" /permissive- /Zc:lambda)
target_compile_options(${LIBNAME_INTERFACE}
INTERFACE $<BUILD_INTERFACE:${OSVR_CXX11_FLAGS}>)
target_compile_options(bsl_internal INTERFACE
-fno-exceptions
-fno-rtti
-fstack-protector-strong
)
target_compile_options(compiler_flags INTERFACE "-pie;-Wall;-Wextra;-Wpedantic;-Wno-attributes;-O3;-g")
target_compile_options(trinity-warning-interface
INTERFACE
-Wno-deprecated-copy)
target_compile_options(immer-dev INTERFACE "--coverage")
target_compile_options(fmt-header-only INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
target_compile_options(juce_recommended_warning_flags INTERFACE "/W4")
target_compile_options(${PROJECT_NAME} INTERFACE
$<$<OR:$<BOOL:${CLANG}>,$<CXX_COMPILER_ID:GNU>>:
-fno-common;
-fstrict-overflow;
-ftrapv;
-pedantic-errors;
-Wall;
-Wcast-align;
-Wdouble-promotion;
-Wextra;
-Wformat=2;
-Wmissing-declarations;
-Wnon-virtual-dtor;
-Wnull-dereference;
-Wold-style-cast;
-Woverloaded-virtual;
-Wshadow;
-Wsign-compare;
-Wundef;
>
$<$<CXX_COMPILER_ID:GNU>:
-Wduplicated-cond;
-Wlogical-op;
>
$<$<BOOL:${CLANG}>:
-Wmissing-variable-declarations;
-Wno-gnu-zero-variadic-macro-arguments; # Required for gtest 1.10.
>
$<$<OR:$<BOOL:${CLANGCL}>,$<CXX_COMPILER_ID:MSVC>>:
/permissive-;
/W4;
/w14254; # 'operator': conversion from 'type1:field_bits' to
# 'type2:field_bits', possible loss of data
/w14263; # 'function': member function does not override any base class
# virtual member function
/w14265; # 'classname': class has virtual functions, but destructor is not
# virtual instances of this class may not be destructed correctly
/w14287; # 'operator': unsigned/negative constant mismatch
/w14289; # nonstandard extension used: 'variable': loop control variable
# declared in the for-loop is used outside the for-loop scope
/w14296; # 'operator': expression is always 'boolean_value'
/w14311; # 'variable': pointer truncation from 'type1' to 'type2'
/w14545; # expression before comma evaluates to a function which is missing
# an argument list
/w14546; # function call before comma missing argument list
/w14547; # 'operator': operator before comma has no effect; expected
# operator with side-effect
/w14549; # 'operator': operator before comma has no effect; did you intend
# 'operator'?
/w14555; # expression has no effect; expected expression with side- effect
/w14619; # pragma warning: there is no warning number 'number'
/w14640; # Enable warning on thread un-safe static member initialization
/w14826; # Conversion from 'type1' to 'type_2' is sign-extended. This may
# cause unexpected runtime behavior.
/w14928; # illegal copy-initialization; more than one user-defined
# conversion has been implicitly applied
/wd4244; # 'argument': conversion from 'int' to 'unsigned char', possible
# loss of data # This one is sort of required for gtest.
/WX;
>
$<$<BOOL:${STRICT_OPTIONS}>:
-Werror;
>
$<$<BOOL:${COMPILER_SUPPORTS_WARNING_WEAK_VTABLES}>:
-Wweak-vtables; # https://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers
>
$<$<BOOL:${COMPILER_SUPPORTS_WDATE_TIME}>:
-Wdate-time; # avoid timestamps in binary for reproducible builds, not added until GCC 4.9
>
$<$<AND:$<NOT:$<BOOL:${WIN32}>>,$<NOT:$<BOOL:${HAIKU}>>>:
-Wstack-protector;
>
)
target_compile_options(DisableExceptions INTERFACE
-fno-exceptions
-fno-rtti
-fno-unwind-tables
-fno-asynchronous-unwind-tables
)
target_compile_options("${target}" INTERFACE "${utf8_flags}")
target_compile_options(igl_common INTERFACE /MP /bigobj)
target_compile_options (
pbrt_warnings
INTERFACE
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4244>" # int -> float conversion
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4267>" # size_t -> int conversion
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4305>" # double constant assigned to float
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4552>" # result of expression not used
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4838>" # double -> int conversion
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4843>" # double -> float conversion
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd26451>" # arithmetic on 4-byte value, then cast to 8-byte
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd26495>" # uninitialized member variable
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4334>" # 32 to 64 bit displacement
"$<$<CXX_COMPILER_ID:MSVC>:$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler >/wd4146>" # NanoVDB: unary minus operator applied to unsigned type, result still unsigned
)
target_compile_options(Tensorflow::pybind11 INTERFACE ${Tensorflow_COMPILE_OPTIONS})
target_compile_options(trinity-compile-option-interface
INTERFACE
-fPIC)
target_compile_options(lexy_dev INTERFACE -pedantic-errors -Werror -Wall -Wextra -Wconversion -Wsign-conversion)
target_compile_options(project_options INTERFACE $<$<CXX_COMPILER_ID:MSVC>:/external:anglebrackets /external:W0>)
target_compile_options(EnTT BEFORE INTERFACE -stdlib=libc++)
target_compile_options(gnu17
INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:-std=gnu++17>
-D_DEFAULT_SOURCE)
target_compile_options(Diligent-BuildSettings INTERFACE
"-pthread"
"-mbulk-memory"
)
target_compile_options(jive_code_coverage
INTERFACE --coverage
)
target_compile_options(Common INTERFACE
# g++
$<$<CXX_COMPILER_ID:GNU>:$<BUILD_INTERFACE:-Wall>>
$<$<CXX_COMPILER_ID:GNU>:-Wno-missing-braces>
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:GNU>:-Wno-ignored-attributes>
$<$<CXX_COMPILER_ID:GNU>:-Wno-unused-local-typedefs>
$<$<CXX_COMPILER_ID:GNU>:-Wno-variadic-macros>
# Clang
$<$<CXX_COMPILER_ID:Clang>:$<BUILD_INTERFACE:-Wall>>
$<$<CXX_COMPILER_ID:Clang>:-Wno-missing-braces>
$<$<CXX_COMPILER_ID:Clang>:-Wno-deprecated-declarations>
$<$<CXX_COMPILER_ID:Clang>:-Wno-ignored-attributes>
# MSVC
$<$<CXX_COMPILER_ID:MSVC>:/bigobj>
$<$<CXX_COMPILER_ID:MSVC>:/wd4003>
$<$<CXX_COMPILER_ID:MSVC>:/wd4996>
)
target_compile_options(Diligent-NativeAppBase INTERFACE /wd4189 /wd4063)
target_compile_options(simdjson-internal-flags INTERFACE /W0 /sdl)
target_compile_options(cpp-utilities-defaults
INTERFACE
-Werror
)
target_compile_options(stl_interfaces INTERFACE -Wall)
target_compile_options(${target}
PRIVATE /interface /ifcOutput ${BMI}
INTERFACE /reference fmt=${BMI})
target_compile_options(webgpu INTERFACE
"--use-port=${emdawnwebgpu_ROOT}/emdawnwebgpu.port.py"
)
target_compile_options(polyfem_warnings INTERFACE ${POLYFEM_WARNING_FLAGS})
target_compile_options(RawSpeed::OpenMP_CXX INTERFACE ${OPENMP_VERSION_SPECIFIER})
target_compile_options(
unit_test_config
INTERFACE
-O0 # no optimization
-g # generate debug info
--coverage # set all required flags to generate code coverage data
)
target_compile_options(lcms2 INTERFACE ${PC_LCMS2_CFLAGS_OTHER})
target_compile_options(options INTERFACE
$<$<CONFIG:RELEASE>:-march=native>
)
target_compile_options(kengine_include INTERFACE /bigobj)
target_compile_options(${target} INTERFACE
$<$<COMPILE_LANGUAGE:${lang}>:${${lang}_WARNINGS}>)
target_compile_options(OneAPI::DPCPP-device INTERFACE ${SYCL_FLAGS})
target_compile_options(coverage_config INTERFACE
-O0
-g
--coverage
)
target_compile_options(SDL3_Headers
INTERFACE
"$<INSTALL_INTERFACE:SHELL:-F $<INSTALL_PREFIX>>"
)
target_compile_options("${PROJECT_NAME}" INTERFACE -Wall -Wextra -pedantic -Werror)
target_compile_options(pybind11 INTERFACE $<BUILD_INTERFACE:${PYBIND11_CPP_STANDARD}>)
target_compile_options(global-group INTERFACE "-Wno-deprecated-declarations")
target_compile_options(${project_name} INTERFACE --coverage -O0 -g)
target_compile_options(microprofile INTERFACE "-Wno-array-bounds")
target_compile_options(std::coroutines INTERFACE ${_CXX_COROUTINES_EXTRA_FLAGS})
target_compile_options (hiactor_private
INTERFACE ${Hiactor_PRIVATE_CXX_FLAGS})
target_compile_options(fmt-header-only INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
target_compile_options(${target}
PRIVATE /interface /ifcOutput ${BMI}
INTERFACE /reference fmt=${BMI})
target_compile_options(geos_developer_cxx_flags
INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:-W4> # consider -analyze
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Werror -pedantic -Wall -Wextra -Wno-long-long -Wcast-align -Wconversion -Wsign-conversion -Wchar-subscripts -Wdouble-promotion -Wpointer-arith -Wformat -Wformat-security -Wshadow -Wuninitialized -Wunused-parameter -fno-common>
$<$<CXX_COMPILER_ID:GNU>:-fno-implicit-inline-templates -Wno-psabi -Wsuggest-attribute=format>
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-unknown-warning-option>
)
target_compile_options(boost_unordered INTERFACE -Wno-error=deprecated-declarations)
target_compile_options(${project_name} INTERFACE --coverage -O0 -g)
target_compile_options(sdl2_mixer INTERFACE "SHELL:-s USE_SDL_MIXER=2")
target_compile_options(JIT INTERFACE ${OpenMP_CXX_FLAGS})
target_compile_options(fast_float INTERFACE /permissive-)
TARGET_COMPILE_OPTIONS(${NAME} INTERFACE ${TPL_COMPILE_OPTIONS})
target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic)
target_compile_options(
${_project_name}
INTERFACE # C++ warnings
$<$<COMPILE_LANGUAGE:CXX>:${PROJECT_WARNINGS_CXX}>
# C warnings
$<$<COMPILE_LANGUAGE:C>:${PROJECT_WARNINGS_C}>
)
target_compile_options(
${_project_name}
INTERFACE # C++ warnings
$<$<COMPILE_LANGUAGE:CXX>:${PROJECT_WARNINGS_CXX}>
# C warnings
$<$<COMPILE_LANGUAGE:C>:${PROJECT_WARNINGS_C}>
)
target_compile_options(
${_project_name}
INTERFACE # C++ warnings
$<$<COMPILE_LANGUAGE:CXX>:${PROJECT_WARNINGS_CXX}>
# C warnings
$<$<COMPILE_LANGUAGE:C>:${PROJECT_WARNINGS_C}>
)
target_compile_options(module INTERFACE -fvisibility=hidden)
target_compile_options(test-dependencies INTERFACE -Wall -Wextra)
target_compile_options(${target}
PRIVATE /interface /ifcOutput ${BMI}
INTERFACE /reference fmt=${BMI})
target_compile_options(cmsd INTERFACE -msse4.2)
target_compile_options(cxxopts INTERFACE ${ICU_CFLAGS})
target_compile_options(hl_sdk_utils_shared INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<CXX_COMPILER_ID:MSVC>:/wd4244 /wd4305 /wd26451>)
target_compile_options(libstdcxx INTERFACE
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xcc -fmodule-map-file=${CMAKE_CURRENT_SOURCE_DIR}/libstdcxx.modulemap>")
target_compile_options(rl_tools_core_definitions INTERFACE
$<$<AND:$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>,$<NOT:$<COMPILE_LANGUAGE:CUDA>>>:
-ftemplate-backtrace-limit=0
>
)
target_compile_options(vamp_cpp INTERFACE ${VAMP_SIMD_FLAGS})
target_compile_options(lagrange_warnings INTERFACE ${options})
target_compile_options(sdl-build-options INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-ZW>" "$<$<COMPILE_LANGUAGE:CXX>:-EHsc>")