diff --git a/cmake-modules/AddTestCMocka.cmake b/cmake-modules/AddTestCMocka.cmake index 354a7a1c57..c941065578 100644 --- a/cmake-modules/AddTestCMocka.cmake +++ b/cmake-modules/AddTestCMocka.cmake @@ -135,17 +135,6 @@ function(ADD_CMOCKA_TEST _TARGET_NAME) ) endif() - # Workaround for linker warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs - if (MSVC) - set_target_properties(${_TARGET_NAME} - PROPERTIES - LINK_FLAGS - "/NODEFAULTLIB:libcmtd.lib" - LINK_FLAGS_RELEASE - "/NODEFAULTLIB:libcmt.lib" - ) - endif() - target_include_directories(${_TARGET_NAME} PRIVATE ${CMOCKA_INCLUDE_DIR}) if (DEFINED _add_cmocka_test_PRIVATE_ACCESS) diff --git a/eng/pipelines/templates/jobs/archetype-sdk-client.yml b/eng/pipelines/templates/jobs/archetype-sdk-client.yml index 48d105b599..23ac2773e2 100644 --- a/eng/pipelines/templates/jobs/archetype-sdk-client.yml +++ b/eng/pipelines/templates/jobs/archetype-sdk-client.yml @@ -81,7 +81,7 @@ jobs: WindowsX86_Release_MapFiles_UnitTests: OSVmImage: 'windows-2019' vcpkg.deps: 'cmocka' - VCPKG_DEFAULT_TRIPLET: 'x86-windows-static' + VCPKG_DEFAULT_TRIPLET: 'x86-windows-static-md' build.args: '-DPRECONDITIONS=OFF -DUNIT_TESTING=ON -DLOGGING=OFF' CMAKE_GENERATOR: 'Visual Studio 16 2019' CMAKE_GENERATOR_PLATFORM: Win32 @@ -169,7 +169,7 @@ jobs: Windows_Preconditions_UnitTests_Samples: OSVmImage: 'windows-2019' vcpkg.deps: 'curl[winssl] paho-mqtt cmocka' - VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' + VCPKG_DEFAULT_TRIPLET: 'x64-windows-static-md' build.args: '-DTRANSPORT_CURL=ON -DTRANSPORT_PAHO=ON -DAZ_PLATFORM_IMPL=WIN32 -DUNIT_TESTING=ON -DLOGGING=OFF' CMAKE_GENERATOR: 'Visual Studio 16 2019' CMAKE_GENERATOR_PLATFORM: x64 @@ -215,7 +215,7 @@ jobs: Windows_Release_MapFiles: OSVmImage: 'windows-2019' vcpkg.deps: '' - VCPKG_DEFAULT_TRIPLET: 'x64-windows-static' + VCPKG_DEFAULT_TRIPLET: 'x64-windows-static-md' build.args: '-DPRECONDITIONS=OFF -DLOGGING=OFF' CMAKE_GENERATOR: 'Visual Studio 16 2019' CMAKE_GENERATOR_PLATFORM: x64 diff --git a/sdk/samples/iot/CMakeLists.txt b/sdk/samples/iot/CMakeLists.txt index 5e6fb864b1..275ad32f0c 100644 --- a/sdk/samples/iot/CMakeLists.txt +++ b/sdk/samples/iot/CMakeLists.txt @@ -39,17 +39,6 @@ target_link_libraries(az_iot_sample_common OpenSSL::Crypto ) -# Workaround for linker warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs -if (MSVC) - set_target_properties(az_iot_sample_common - PROPERTIES - LINK_FLAGS - "/NODEFAULTLIB:libcmtd.lib" - LINK_FLAGS_RELEASE - "/NODEFAULTLIB:libcmt.lib" - ) -endif() - add_library (az::iot::sample::common ALIAS az_iot_sample_common) # Azure IoT Samples Executables @@ -154,24 +143,4 @@ target_link_libraries(paho_iot_provisioning_sas_sample az::iot::sample::common ) -# Workaround for linker warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs -if (MSVC) - set_target_properties( - paho_iot_hub_c2d_sample - paho_iot_hub_methods_sample - paho_iot_hub_pnp_component_sample - paho_iot_hub_pnp_sample - paho_iot_hub_telemetry_sample - paho_iot_hub_sas_telemetry_sample - paho_iot_hub_twin_sample - paho_iot_provisioning_sample - paho_iot_provisioning_sas_sample - PROPERTIES - LINK_FLAGS - "/NODEFAULTLIB:libcmtd.lib" - LINK_FLAGS_RELEASE - "/NODEFAULTLIB:libcmt.lib" - ) -endif() - endif() # TRANSPORT_PAHO diff --git a/sdk/tests/iot/common/CMakeLists.txt b/sdk/tests/iot/common/CMakeLists.txt index 955273d2ab..99fd305c9b 100644 --- a/sdk/tests/iot/common/CMakeLists.txt +++ b/sdk/tests/iot/common/CMakeLists.txt @@ -18,5 +18,4 @@ add_cmocka_test(az_iot_common_test SOURCES LINK_TARGETS az_iot_common az_core - ${PAL} ) diff --git a/sdk/tests/iot/hub/CMakeLists.txt b/sdk/tests/iot/hub/CMakeLists.txt index 81260c1528..5b7f44f135 100644 --- a/sdk/tests/iot/hub/CMakeLists.txt +++ b/sdk/tests/iot/hub/CMakeLists.txt @@ -24,5 +24,4 @@ add_cmocka_test(az_iot_hub_test SOURCES az_iot_common az_iot_hub az_core - ${PAL} ) diff --git a/sdk/tests/iot/provisioning/CMakeLists.txt b/sdk/tests/iot/provisioning/CMakeLists.txt index 61bc3a5028..1b78ce9f90 100644 --- a/sdk/tests/iot/provisioning/CMakeLists.txt +++ b/sdk/tests/iot/provisioning/CMakeLists.txt @@ -21,5 +21,4 @@ add_cmocka_test(az_iot_provisioning_test SOURCES az_iot_common az_iot_provisioning az_core - ${PAL} )