Skip to content

Commit

Permalink
Update vcpkg baseline to the October 2022 tag. (#2400)
Browse files Browse the repository at this point in the history
* Update vcpkg baseline to the October 2022 tag.

* Update cmake module to use the new commit sha.

* Update IoT samples to include the correct MQTTClient header file.

* Remove the overrides as it should not be necessary with the latest baseline.

* Add debugging messages to powershell script and cmake module.

* Print out the vcpkg root and installation root env var values.

* Remove the use of VCPKG_ROOT and VCPKG_INSTALLATION_ROOT from the cmake module.

* Update debug messages and revert changes to vcpkg.ps1 since it isn't used anywhere.
  • Loading branch information
ahsonkhan committed Nov 9, 2022
1 parent 070162c commit 25f8096
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 49 deletions.
56 changes: 26 additions & 30 deletions cmake-modules/AzureVcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,37 @@
# Defines utilities for Azure SDK to integrate with VCPKG automatically

macro(az_vcpkg_integrate)
message("Vcpkg integrate step.")
# AUTO CMAKE_TOOLCHAIN_FILE:
# User can call `cmake -DCMAKE_TOOLCHAIN_FILE="path_to_the_toolchain"` as the most specific scenario.
# An env var VCPKG_ROOT or VCPKG_INSTALLATION_ROOT can be set to let Azure SDK to set the VCPKG toolchain automatically.
# As the last alternative (default case), Azure SDK will automatically clone VCPKG folder and set toolchain from there.
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VCPKG_ROOT})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
elseif(DEFINED ENV{VCPKG_INSTALLATION_ROOT})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
else()
# Set AZURE_SDK_DISABLE_AUTO_VCPKG env var to avoid Azure SDK from cloning and setting VCPKG automatically
# This option delegate package's dependencies installation to user.
if(NOT DEFINED ENV{AZURE_SDK_DISABLE_AUTO_VCPKG})
# GET VCPKG FROM SOURCE
# User can set env var AZURE_SDK_VCPKG_COMMIT to pick the VCPKG commit to fetch
set(VCPKG_COMMIT_STRING f0aa678b7471497f1adedcc99f40e1599ad22f69) # default SDK tested commit
if(DEFINED ENV{AZURE_SDK_VCPKG_COMMIT})
set(VCPKG_COMMIT_STRING "$ENV{AZURE_SDK_VCPKG_COMMIT}") # default SDK tested commit
endif()
include(FetchContent)
FetchContent_Declare(
vcpkg
GIT_REPOSITORY https://github.com/microsoft/vcpkg.git
GIT_TAG ${VCPKG_COMMIT_STRING}
)
FetchContent_GetProperties(vcpkg)
# make sure to pull vcpkg only once.
if(NOT vcpkg_POPULATED)
FetchContent_Populate(vcpkg)
endif()
# use the vcpkg source path
set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
message("CMAKE_TOOLCHAIN_FILE is not defined. Define it for the user.")
# Set AZURE_SDK_DISABLE_AUTO_VCPKG env var to avoid Azure SDK from cloning and setting VCPKG automatically
# This option delegate package's dependencies installation to user.
if(NOT DEFINED ENV{AZURE_SDK_DISABLE_AUTO_VCPKG})
message("AZURE_SDK_DISABLE_AUTO_VCPKG is not defined. Fetch a local copy of vcpkg.")
# GET VCPKG FROM SOURCE
# User can set env var AZURE_SDK_VCPKG_COMMIT to pick the VCPKG commit to fetch
set(VCPKG_COMMIT_STRING 94ce0dab56f4d8ba6bd631ba59ed682b02d45c46) # default SDK tested commit
if(DEFINED ENV{AZURE_SDK_VCPKG_COMMIT})
message("AZURE_SDK_VCPKG_COMMIT is defined. Using that instead of the default.")
set(VCPKG_COMMIT_STRING "$ENV{AZURE_SDK_VCPKG_COMMIT}") # default SDK tested commit
endif()
message("Vcpkg commit string used: ${VCPKG_COMMIT_STRING}")
include(FetchContent)
FetchContent_Declare(
vcpkg
GIT_REPOSITORY https://github.com/microsoft/vcpkg.git
GIT_TAG ${VCPKG_COMMIT_STRING}
)
FetchContent_GetProperties(vcpkg)
# make sure to pull vcpkg only once.
if(NOT vcpkg_POPULATED)
FetchContent_Populate(vcpkg)
endif()
# use the vcpkg source path
set(CMAKE_TOOLCHAIN_FILE "${vcpkg_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion eng/vcpkg-commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tags/2020.06
tags/2022.10.19
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_hub_c2d_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_hub_methods_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_hub_sas_telemetry_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_hub_telemetry_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_hub_twin_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_pnp_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_pnp_sample_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_pnp_with_provisioning_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_provisioning_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/paho_iot_provisioning_sas_sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
2 changes: 1 addition & 1 deletion sdk/samples/iot/pnp/pnp_mqtt_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// warning C4201: nonstandard extension used: nameless struct/union
#pragma warning(disable : 4201)
#endif
#include <paho-mqtt/MQTTClient.h>
#include <MQTTClient.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
Expand Down
8 changes: 1 addition & 7 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure-sdk-for-c",
"version": "1.0.0",
"builtin-baseline": "f0aa678b7471497f1adedcc99f40e1599ad22f69",
"builtin-baseline": "94ce0dab56f4d8ba6bd631ba59ed682b02d45c46",
"dependencies": [
{
"name": "curl"
Expand All @@ -12,11 +12,5 @@
{
"name": "cmocka"
}
],
"overrides": [
{
"name": "zlib",
"version": "1.2.12#2"
}
]
}

0 comments on commit 25f8096

Please sign in to comment.