Skip to content

Commit

Permalink
Update mqtt version (#83)
Browse files Browse the repository at this point in the history
* Updated deps to latest, improved cmake module searching and libdir

* Incremented version number.
  • Loading branch information
JonathanHenson authored Dec 3, 2019
1 parent f58eefb commit 644dead
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 20 deletions.
21 changes: 18 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.1)

option(BUILD_DEPS "Builds aws common runtime dependencies as part of build, only do this if you don't want to control your dependency chain." OFF)

if (DEFINED CMAKE_PREFIX_PATH)
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
endif()

if (DEFINED CMAKE_INSTALL_PREFIX)
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
endif()

if (UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
Expand All @@ -20,7 +28,7 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()

set(AWS_CRT_CPP_VERSION "v0.6.5")
set(AWS_CRT_CPP_VERSION "v0.6.8")

configure_file(include/aws/crt/Config.h.in ${CMAKE_CURRENT_LIST_DIR}/include/aws/crt/Config.h @ONLY)

Expand Down Expand Up @@ -53,7 +61,8 @@ if (BUILD_DEPS)
-DCMAKE_PREFIX_PATH=${AWS_DEPS_INSTALL_DIR}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
${CMAKE_CURRENT_SOURCE_DIR}/aws-common-runtime
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
${CMAKE_CURRENT_SOURCE_DIR}/aws-common-runtime
WORKING_DIRECTORY ${AWS_DEPS_BUILD_DIR}
)

Expand All @@ -69,6 +78,7 @@ if (BUILD_DEPS)
-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_CURRENT_BINARY_DIR}/bin
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
${CMAKE_CURRENT_SOURCE_DIR}/aws-common-runtime
WORKING_DIRECTORY ${AWS_DEPS_BUILD_DIR}
RESULT_VARIABLE BUILD_AWSCRT_EXIT_CODE
Expand Down Expand Up @@ -98,7 +108,12 @@ else()
project(aws-crt-cpp)

endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")

# This is required in order to append /lib/cmake to each element in CMAKE_PREFIX_PATH
set(AWS_MODULE_DIR "/${CMAKE_INSTALL_LIBDIR}/cmake")
string(REPLACE ";" "${AWS_MODULE_DIR};" AWS_MODULE_PATH "${CMAKE_PREFIX_PATH}${AWS_MODULE_DIR}")
# Append that generated list to the module search path
list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH})

include(AwsCFlags)
include(AwsSharedLibSetup)
Expand Down
8 changes: 4 additions & 4 deletions aws-common-runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(aws-crt)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()

include(ExternalProject)
Expand All @@ -17,7 +17,7 @@ set(AWS_DEPS_DOWNLOAD_DIR "${AWS_DEPS_BUILD_DIR}/downloads" CACHE PATH "Dependen

message("install dir ${AWS_DEPS_INSTALL_DIR}")
set(AWS_C_COMMON_URL "https://github.com/awslabs/aws-c-common.git")
set(AWS_C_COMMON_SHA "v0.4.22")
set(AWS_C_COMMON_SHA "v0.4.23")
include(BuildAwsCCommon)

if (UNIX AND NOT APPLE)
Expand All @@ -27,7 +27,7 @@ if (UNIX AND NOT APPLE)
endif()

set(AWS_C_IO_URL "https://github.com/awslabs/aws-c-io.git")
set(AWS_C_IO_SHA "v0.4.17")
set(AWS_C_IO_SHA "v0.4.18")
include(BuildAwsCIO)

set(AWS_C_COMPRESSION_URL "https://github.com/awslabs/aws-c-compression.git")
Expand All @@ -39,7 +39,7 @@ set(AWS_C_HTTP_SHA "v0.4.17")
include(BuildAwsCHttp)

set(AWS_C_MQTT_URL "https://github.com/awslabs/aws-c-mqtt.git")
set(AWS_C_MQTT_SHA "v0.4.17")
set(AWS_C_MQTT_SHA "v0.4.18")
include(BuildAwsCMqtt)

set(AWS_C_CAL_URL "https://github.com/awslabs/aws-c-cal.git")
Expand Down
8 changes: 6 additions & 2 deletions aws-common-runtime/cmake/BuildAwsCAuth.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCAuth
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -34,6 +35,7 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCAuth
Expand All @@ -49,5 +51,7 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()

7 changes: 5 additions & 2 deletions aws-common-runtime/cmake/BuildAwsCCal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCCal
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -34,7 +35,8 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCCal
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -49,5 +51,6 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()
5 changes: 4 additions & 1 deletion aws-common-runtime/cmake/BuildAwsCCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCCommon
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -36,6 +37,7 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCCommon
Expand All @@ -52,5 +54,6 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()
7 changes: 5 additions & 2 deletions aws-common-runtime/cmake/BuildAwsCCompression.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCCompression
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -34,6 +35,7 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCCompression
Expand All @@ -49,5 +51,6 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()
endif()
5 changes: 4 additions & 1 deletion aws-common-runtime/cmake/BuildAwsCHttp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCHttp
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -34,6 +35,7 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCHttp
Expand All @@ -49,5 +51,6 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()
5 changes: 4 additions & 1 deletion aws-common-runtime/cmake/BuildAwsCIO.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCIO
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -36,6 +37,7 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCIO
Expand All @@ -52,5 +54,6 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()
5 changes: 4 additions & 1 deletion aws-common-runtime/cmake/BuildAwsCMqtt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DENABLE_HW_OPTIMIZATION=OFF
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
elseif(MSVC)
ExternalProject_Add(AwsCMqtt
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -34,6 +35,7 @@ elseif(MSVC)
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(AwsCMqtt
Expand All @@ -49,5 +51,6 @@ else()
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()
6 changes: 3 additions & 3 deletions aws-common-runtime/cmake/BuildS2N.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if("${TARGET_ARCH}" STREQUAL ANDROID)
-DANDROID_STL=${ANDROID_STL}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DBUILD_TESTING=OFF
-DUSE_S2N_PQ_CRYPTO=OFF
)
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
else()
ExternalProject_Add(S2N
PREFIX ${AWS_DEPS_BUILD_DIR}
Expand All @@ -39,6 +39,6 @@ else()
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DBUILD_TESTING=OFF
-DUSE_S2N_PQ_CRYPTO=OFF
-DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
)
endif()

0 comments on commit 644dead

Please sign in to comment.