{% set os = detect_api.detect_os() %} {% set arch = detect_api.detect_arch() %} {% set compiler, version, compiler_exe = detect_api.detect_default_compiler() %} {% set compiler_version = version %} {% if os == "Linux" %} {% set compiler_version = detect_api.default_compiler_version(compiler, version) %} {% endif %} [settings] os={{ os }} arch={{ arch }} build_type=Debug compiler={{compiler}} compiler.version={{ compiler_version }} compiler.cppstd=20 {% if os == "Windows" %} compiler.runtime=static {% else %} compiler.libcxx={{detect_api.detect_libcxx(compiler, version, compiler_exe)}} {% endif %} [conf] {% if compiler == "gcc" and compiler_version < 13 %} tools.build:cxxflags+=['-Wno-restrict'] {% endif %} {% if os == "Windows" %} # opentelemetry-cpp's recipe removes the `shared` option on Windows and never # sets BUILD_SHARED_LIBS, so its upstream CMake defaults the protobuf-generated # `opentelemetry_proto` target to a DLL (opentelemetry_proto.dll). The rest of # the project links statically and nothing deploys that DLL next to the # executables, so the telemetry unit test fails to start with # STATUS_DLL_NOT_FOUND (0xC0000135). Force the dependency to build fully static # so no runtime DLL is produced. The conf is folded into the package id so a # fresh static binary is built instead of reusing a previously cached one. opentelemetry-cpp/*:tools.cmake.cmaketoolchain:extra_variables={"BUILD_SHARED_LIBS": "OFF"} opentelemetry-cpp/*:tools.info.package_id:confs+=["tools.cmake.cmaketoolchain:extra_variables"] {% endif %}