cmake target_link_options examples

Signatures

target_link_options(<target> [BEFORE]
  <INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])

Examples

geodynamics/aspect contrib/world_builder/CMakeLists.txt :469

target_link_options(${WB_TARGET} INTERFACE ${WB_LINKER_OPTIONS})

o3de/o3de cmake/LYWrappers.cmake :496

target_link_options(${dest_target} INTERFACE $<GENEX_EVAL:$<TARGET_PROPERTY:${source_target_de_alias},INTERFACE_LINK_OPTIONS>>)

godlikepanos/anki-3d-engine ThirdParty/Sdl3/cmake/sdltargets.cmake :57

target_link_options(${target} INTERFACE ${ARGS_LINK_OPTIONS})

facebookresearch/habitat-sim src/cmake/FindMagnumPlugins.cmake :652

target_link_options(MagnumPlugins::${_component} INTERFACE $<$<CONFIG:Release>:-Wl,-u,scalbnf>)

cadaver/turso3d ThirdParty/SDL/cmake/sdltargets.cmake :57

target_link_options(${target} INTERFACE ${ARGS_LINK_OPTIONS})

Hork-Engine/Hork-Source ThirdParty/SDL3/cmake/sdltargets.cmake :57

target_link_options(${target} INTERFACE ${ARGS_LINK_OPTIONS})

RavEngine/RavEngine deps/RGL/deps/Vulkan-Utility-Libraries/src/CMakeLists.txt :87

target_link_options(VulkanCompilerConfiguration INTERFACE /WX)

bmwcarit/ramses cmake/ramses/platformConfig.cmake :108

target_link_options(ramses-build-options-base INTERFACE --coverage)

alpaka-group/alpaka cmake/alpakaCommon.cmake :226

target_link_options(alpaka INTERFACE "$<$<AND:$<CONFIG:Debug>,$<CXX_COMPILER_ID:GNU>>:SHELL:-Og>"
                                         "$<$<AND:$<CONFIG:Debug>,$<CXX_COMPILER_ID:Clang,AppleClang,IntelLLVM>>:SHELL:-O0>")

ElyPrismLauncher/ElyPrismLauncher cmake/CompilerWarnings.cmake :32

target_link_options(${_project_name} INTERFACE ${OPTIONS})

erleben/OpenTissue unit_tests/CMakeLists.txt :28

target_link_options(OpenTissue INTERFACE --coverage)

kahypar/mt-kahypar CMakeLists.txt :275

target_link_options(MtKaHyPar-BuildFlags INTERFACE -lgcov --coverage)

PrismLauncher/PrismLauncher cmake/CompilerWarnings.cmake :32

target_link_options(${_project_name} INTERFACE ${OPTIONS})

NVIDIA/nvshmem CMakeLists.txt :138

target_link_options(shmem INTERFACE ${SHMEM_C_LINK_FLAGS})

SsageParuders/Android_Native_Surface my_android_opencv/cmake/OpenCVFindIPP.cmake :161

target_link_options(ipp${name} INTERFACE "LINKER:--exclude-libs,${_filename}")

OpenKneeboard/OpenKneeboard third-party/cef.cmake :91

target_link_options(
    Cef::LibCef
    INTERFACE
    "${CEF_LINKER_FLAGS}"
    "$<IF:$<CONFIG:Debug>,${CEF_LINKER_FLAGS_DEBUG},${CEF_LINKER_FLAGS_RELEASE}>"
    "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CEF_EXE_LINKER_FLAGS};$<IF:$<CONFIG:Debug>,${CEF_EXE_LINKER_FLAGS_DEBUG},${CEF_EXE_LINKER_FLAGS_RELEASE}>>"
    "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CEF_SHARED_LINKER_FLAGS};$<IF:$<CONFIG:Debug>,${CEF_SHARED_LINKER_FLAGS_DEBUG},${CEF_SHARED_LINKER_FLAGS_RELEASE}>>"
    "$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CEF_SHARED_LINKER_FLAGS};$<IF:$<CONFIG:Debug>,${CEF_SHARED_LINKER_FLAGS_DEBUG},${CEF_SHARED_LINKER_FLAGS_RELEASE}>>"
)

NVIDIA/MatX CMakeLists.txt :271

target_link_options(matx INTERFACE -lgcov --coverage)

TheAssemblyArmada/Thyme deps/olddx/CMakeLists.txt :13

target_link_options(d3d8 INTERFACE /SAFESEH:NO /NODEFAULTLIB:libci.lib)

OpenMW/openmw components/CMakeLists.txt :682

target_link_options(components_osg_plugins INTERFACE ${_opts})

zeek/zeek CMakeLists.txt :387

target_link_options(zeek_dynamic_plugin_base INTERFACE -undefined dynamic_lookup
                        -Wl,-bind_at_load)

NERSC/timemory cmake/Modules/BuildSettings.cmake :117

target_link_options(timemory-compile-debuginfo INTERFACE
                        $<$<CXX_COMPILER_ID:GNU>:-rdynamic>)

STEllAR-GROUP/hpx cmake/HPX_AddLinkFlag.cmake :48

target_link_options(${_dest} INTERFACE "${_flag}")

dartsim/dart CMakeLists.txt :158

target_link_options(coverage_config INTERFACE --coverage)

CLIUtils/CLI11 cmake/CLI11Warnings.cmake :35

target_link_options(CLI11_warnings INTERFACE $<$<BOOL:${CLI11_FORCE_LIBCXX}>:-stdlib=libc++>)

google/filament third_party/dawn/src/emdawnwebgpu/CMakeLists.txt :192

target_link_options(emdawnwebgpu_c INTERFACE
        # IMPORTANT: If changing these dependencies, update EMDAWNWEBGPU_C_ALL_FILE_DEPS too.
        "--js-library=${EM_BUILD_GEN_DIR}/library_webgpu_enum_tables.js"
        "--js-library=${EM_BUILD_GEN_DIR}/library_webgpu_generated_sig_info.js"
        "--js-library=${EM_BUILD_GEN_DIR}/library_webgpu_generated_struct_info.js"
        "--js-library=${DAWN_EMDAWNWEBGPU_DIR}/pkg/webgpu/src/library_webgpu.js"
        "--closure-args=--externs=${DAWN_EMDAWNWEBGPU_DIR}/pkg/webgpu/src/webgpu-externs.js"
    )

NREL/EnergyPlus cmake/CompilerFlags.cmake :64

target_link_options(project_options INTERFACE $<$<CONFIG:Release>:/guard:cf>)

Devsh-Graphics-Programming/Nabla 3rdparty/ngfx/ngfx.cmake :65

target_link_options(ngfx INTERFACE "/DELAYLOAD:NGFX_Injection.dll")

mysql/mysql-server cmake/googletest.cmake :83

TARGET_LINK_OPTIONS(gtest INTERFACE -Wno-error=stringop-overflow)

manticoresoftware/manticoresearch CMakeLists.txt :196

target_link_options ( lextra INTERFACE
			$<$<LINK_LANG_AND_ID:CXX,GNU>:-lgcov --coverage>
			$<$<LINK_LANG_AND_ID:C,GNU>:-lgcov --coverage>
			$<$<LINK_LANG_AND_ID:CXX,Clang,AppleClang>: --coverage>
			$<$<LINK_LANG_AND_ID:C,Clang,AppleClang>: --coverage>
			)

stephenberry/glaze CMakeLists.txt :32

target_link_options(glaze_glaze INTERFACE 
        $<$<CONFIG:Release>:/LTCG /INCREMENTAL:NO>
        $<$<CONFIG:MinSizeRel>:/LTCG /INCREMENTAL:NO>)

anira-project/anira cmake/SetupLibTorch.cmake :106

target_link_options(torch INTERFACE "-w")

mkiol/dsnote CMakeLists.txt :464

target_link_options(compiler_flags INTERFACE
              "-pie;-static-libasan;-static-libubsan;-fsanitize=address,undefined")

qTox/qTox CMakeLists.txt :615

target_link_options(coverage_config INTERFACE --coverage)

fooyin/fooyin CMakeLists.txt :214

target_link_options(fooyin_pch INTERFACE ${FOOYIN_LINK_OPTIONS})

qt/qtbase cmake/QtInternalTargets.cmake :302

target_link_options(PlatformCommonInternal INTERFACE
        "$<$<AND:${not_disabled},${is_xcode15}>:LINKER:-no_warn_duplicate_libraries>")

Qihoo360/tensornet cmake/FindTensorflow.cmake :80

target_link_options(Tensorflow::framework INTERFACE ${Tensorflow_LIBRARY_OPTIONS})

Dreamtowards/Ethertia lib/json-nlohmann-3.11.2/cmake/test.cmake :94

target_link_options(${test_interface} INTERFACE ${args_LINK_OPTIONS})

project-chip/connectedhomeip config/common/cmake/chip_gn.cmake :197

target_link_options(${target} INTERFACE -Wl,--whole-archive ${MATTER_LIB_DIR}/libCHIPShell.a -Wl,--no-whole-archive)

ComputationalBiomechanicsLab/opensim-creator third_party/mdspan/CMakeLists.txt :144

target_link_options(mdspan INTERFACE "-fsycl")

ImJimmi/JIVE cmake/jive_code_coverage.cmake :18

target_link_options(jive_code_coverage
                        INTERFACE
                        --coverage
    )

matus-chochlik/mirror include/mirror/CMakeLists.txt :32

target_link_options(
	mirror-headers
	INTERFACE -std=c++2b -stdlib=libc++
)

ClickHouse/ClickHouse CMakeLists.txt :415

target_link_options(global-group INTERFACE "LINKER:--no-undefined")

Chatterino/chatterino2 lib/twitch-eventsub-ws/src/CMakeLists.txt :92

target_link_options(${PROJECT_NAME} INTERFACE "/NATVIS:${_natvis_path}")

Jackarain/proxy third_party/snmalloc/CMakeLists.txt :271

target_link_options(snmalloc INTERFACE $<${ci_or_debug}:-rdynamic>)

eliemichel/WebGPU-distribution emdawnwebgpu/CMakeLists.txt :77

target_link_options(webgpu INTERFACE
	"--use-port=${emdawnwebgpu_ROOT}/emdawnwebgpu.port.py"
	"--closure-args=--externs=${emdawnwebgpu_ROOT}/webgpu/src/webgpu-externs.js"
)

polyfem/polyfem CMakeLists.txt :88

target_link_options(polyfem_coverage_config INTERFACE --coverage)

fktn-k/fkYAML tests/unit_test/CMakeLists.txt :146

target_link_options(
  unit_test_config
  INTERFACE
    $<$<CXX_COMPILER_ID:IntelLLVM>:
      $<$<CONFIG:Debug>:-O0 -g>
      $<$<CONFIG:Release>:-O2>
    >
)

mosra/magnum-plugins modules/FindMagnumPlugins.cmake :673

target_link_options(MagnumPlugins::${_component} INTERFACE $<$<CONFIG:Release>:-Wl,-u,scalbnf>)

sxs-collaboration/spectre cmake/SetupCxxFlags.cmake :99

target_link_options(
    SpectreFlags
    INTERFACE
    -Wl,-w
    )

ossia/libossia cmake/deps/sdl.cmake :7

target_link_options(ossia_sdl2 INTERFACE "SHELL:-s USE_SDL=2")

libjxl/libjxl cmake/FindBrotli.cmake :40

target_link_options(${brlib}
        INTERFACE ${PC_${BRPREFIX}_LDFLAGS_OTHER})

LensPlaysGames/LensorCompilerCollection CMakeLists.txt :158

target_link_options(options INTERFACE
        $<$<CONFIG:DEBUG>:-O0 -g3 -ggdb3 -rdynamic>
        $<$<CONFIG:RELEASE>:-O3 -march=native>
    )

halide/Halide apps/linear_algebra/CMakeLists.txt :48

target_link_options(BLAS::${BLA_VENDOR} INTERFACE ${BLAS_LINKER_FLAGS})

realm/realm-core src/realm/CMakeLists.txt :373

target_link_options(Storage INTERFACE LINKER:-gc-sections)

QMCPACK/qmcpack CMake/IntelDPCPPConfig-modified.cmake :309

target_link_options(OneAPI::DPCPP-device INTERFACE ${SYCL_FLAGS})

mayataka/robotoc CMakeLists.txt :102

target_link_options(coverage_config INTERFACE --coverage)

cvet/fonline ThirdParty/mongo-c-driver/build/cmake/MongoPlatform.cmake :49

target_link_options(_mongo-platform INTERFACE ${ARGN})

AshampooSystems/boden framework/ui/platforms/ios/CMakeLists.txt :5

target_link_options(ui_ios INTERFACE -ObjC)

OriginHubAI/MyScaleDB CMakeLists.txt :410

target_link_options(global-group INTERFACE "LINKER:--no-undefined")

BearWare/TeamTalk5 Library/TeamTalkLib/build/libvpx/CMakeLists.txt :254

target_link_options(libvpx INTERFACE "-Wl,-Bsymbolic")

dealii/dealii cmake/macros/macro_copy_target_properties.cmake :154

target_link_options(${_destination_target} INTERFACE ${_link_options})

PCSX2/pcsx2 pcsx2/CMakeLists.txt :745

target_link_options(PCSX2_FLAGS INTERFACE -Wno-odr)

trilinos/Trilinos cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake :899

target_link_options(${tplName}::all_libs\n")
    foreach (likLinkFlag IN LISTS libLinkFlags)
      string(APPEND configFileStr
        "  INTERFACE \"${likLinkFlag}\"\n")
    endforeach()
    string(APPEND configFileStr
      "  )

fn2006/PollyMC cmake/CompilerWarnings.cmake :32

target_link_options(${_project_name} INTERFACE ${OPTIONS})

unmojang/FjordLauncher cmake/CompilerWarnings.cmake :32

target_link_options(${_project_name} INTERFACE ${OPTIONS})

FreesmTeam/FreesmLauncher cmake/CompilerWarnings.cmake :32

target_link_options(${_project_name} INTERFACE ${OPTIONS})

peercoin/peercoin src/secp256k1/examples/CMakeLists.txt :16

target_link_options(example INTERFACE /IGNORE:4217)

kokkos/mdspan CMakeLists.txt :128

target_link_options(mdspan INTERFACE "-fsycl")

adobe/lagrange cmake/recipes/external/glfw.cmake :21

target_link_options(glfw INTERFACE
        "SHELL:-s MAX_WEBGL_VERSION=2"
        "SHELL:-s USE_GLFW=3"
        -lglfw
    )

OpenMS/OpenMS src/openms/extern/nlohmann_json/cmake/test.cmake :94

target_link_options(${test_interface} INTERFACE ${args_LINK_OPTIONS})

Lewuathe/mlir-hello thirdparty/llvm-project/libcxx/cmake/Modules/HandleLibC.cmake :34

target_link_options(libcxx-libc-static INTERFACE "-nolibc")

qt/qtmultimedia cmake/FindFFmpeg.cmake :341

target_link_options(${_target} INTERFACE  "-Wl,--exclude-libs=lib${_lowerComponent}")

Kitware/VTK CMakeLists.txt :826

target_link_options(vtkWebAssemblyTestLinkOptions INTERFACE
        "-sSINGLE_FILE=1"
        # For stack trace to show human-readable function names
        "--profiling-funcs"
        # we need emscripten to emit code that handles exit code and atexit(s)
        "-sEXIT_RUNTIME=1"
        # ENV holds the environment variables accessible by C getenv
        "-sEXPORTED_RUNTIME_METHODS=['ENV']"
        # tests dynamically allocate memory, can easily go over the preset limit.
        "-sALLOW_MEMORY_GROWTH=1")

openswoole/ext-openswoole CMakeLists.txt :49

target_link_options(coverage_config INTERFACE --coverage)

free-audio/clap-wrapper cmake/shared_prologue.cmake :85

target_link_options(clap-wrapper-sanitizer-options INTERFACE
                -fsanitize=address,undefined,float-divide-by-zero
                -fsanitize-address-use-after-return=always
                -fsanitize-address-use-after-scope
                )

WujekFoliarz/DualSenseY-v2 thirdparty/json/cmake/test.cmake :94

target_link_options(${test_interface} INTERFACE ${args_LINK_OPTIONS})

gperftools/gperftools CMakeLists.txt :518

target_link_options(tcmalloc_minimal INTERFACE ${TCMALLOC_FLAGS})

CGAL/cgal Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake :116

target_link_options(${target} INTERFACE -fsanitize=address)

kyubotics/cqcppsdk CMakeLists.txt :44

target_link_options(cqcppsdk_std_mode INTERFACE -static -Wl,--kill-at,--enable-stdcall-fixup)

versatran01/dsol cmake/Sanitizers.cmake :64

target_link_options(${TARGET} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})

microsoft/pict CMakeLists.txt :76

target_link_options(${PICT_BUILD_OPTIONS}
      INTERFACE
        $<IF:$<CONFIG:Debug>,,LINKER:-flto$<COMMA>-flto-partition=none> #Enable LTO
        $<IF:$<CONFIG:Debug>,,LINKER:--no-undefined> # Have Linker error out if any symbols are undefined.
    )

sandialabs/seacas cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake :899

target_link_options(${tplName}::all_libs\n")
    foreach (likLinkFlag IN LISTS libLinkFlags)
      string(APPEND configFileStr
        "  INTERFACE \"${likLinkFlag}\"\n")
    endforeach()
    string(APPEND configFileStr
      "  )

pimoroni/pimoroni-pico micropython/modules/micropython-disable-exceptions.cmake :9

target_link_options(usermod INTERFACE -specs=nano.specs)

bouffalolab/bouffalo_sdk cmake/extension.cmake :139

target_link_options(sdk_intf_lib INTERFACE ${ARGV})

fluent/fluent-bit lib/wasm-micro-runtime-WAMR-2.4.1/samples/wasm-c-api-imports/CMakeLists.txt :101

target_link_options(vmlib INTERFACE -fsanitize=address,undefined)

FreeRDP/FreeRDP channels/rdpear/common/CMakeLists.txt :26

target_link_options(rdpear-common INTERFACE ${KRB5_LDFLAGS})

AOMediaCodec/libavif cmake/Modules/LocalRav1e.cmake :103

target_link_options(rav1e::rav1e INTERFACE "${Rust_CARGO_TARGET_LINK_OPTIONS}")

afni/afni cmake/FindMotif.cmake :76

target_link_options(Motif INTERFACE $<$<NOT:$<BOOL:${APPLE}>>:LINKER:--no-as-needed>)

apache/celix bundles/logging/log_helper/error_injector/CMakeLists.txt :23

target_link_options(log_helper_ei INTERFACE LINKER:--wrap,celix_logHelper_create)

Sneeds-Feed-and-Seed/sneedacity cmake-proxies/ffmpeg/CMakeLists.txt :83

target_link_options( ${TARGET} INTERFACE ${LOPTS} )

facebook/bpfilter CMakeLists.txt :66

target_link_options(bf_global_flags
    INTERFACE
        $<$<CONFIG:debug>:-fsanitize=address -fsanitize=undefined>
)

jdthomas/bayer2rgb cmake/Sanitizers.cmake :63

target_link_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})

nanoporetech/dorado cmake/Torch.cmake :475

target_link_options(torch_lib INTERFACE "LINKER:--no-relax")

CTSRD-CHERI/cheribsd contrib/subrepo-cheri-libc++/benchmarks/CMakeLists.txt :88

target_link_options(   cxx-benchmarks-flags-native INTERFACE ${BENCHMARK_NATIVE_TARGET_FLAGS} "-L${BENCHMARK_NATIVE_INSTALL}/lib")

nrfconnect/sdk-zephyr arch/posix/CMakeLists.txt :51

target_link_options(native_simulator INTERFACE "-m64")

embeddedartistry/libc src/CMakeLists.txt :137

target_link_options(c INTERFACE "-nolibc")

tanis2000/binocle-c src/deps/sdl/cmake/sdltargets.cmake :57

target_link_options(${target} INTERFACE ${ARGS_LINK_OPTIONS})

CloudMracek/PSBW cmake/setup.cmake :74

target_link_options(
	flags INTERFACE
		-static
		-nostdlib
		-Wl,-gc-sections
		-G8
		-T${CMAKE_CURRENT_LIST_DIR}/executable.ld
)

fossasia/pslab-mini-firmware cmake/stm32/c0.cmake :23

target_link_options(STM32::C0 INTERFACE 
    -mcpu=cortex-m0plus
)