Skip to content

Commit

Permalink
Fix all samples
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Dec 2, 2024
1 parent 46b10ef commit 18eacfd
Show file tree
Hide file tree
Showing 24 changed files with 116 additions and 300 deletions.
18 changes: 5 additions & 13 deletions samples/device_defender/basic_report/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ if (UNIX AND NOT APPLE)
find_package(IotDeviceCommon-cpp REQUIRED)
find_package(IotDeviceDefender-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::IotDeviceCommon-cpp AWS::IotDeviceDefender-cpp)

endif()
18 changes: 5 additions & 13 deletions samples/device_defender/mqtt5_basic_report/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ if (UNIX AND NOT APPLE)
find_package(IotDeviceCommon-cpp REQUIRED)
find_package(IotDeviceDefender-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::IotDeviceCommon-cpp AWS::IotDeviceDefender-cpp)

endif()
18 changes: 5 additions & 13 deletions samples/fleet_provisioning/fleet_provisioning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(IotIdentity-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::IotIdentity-cpp)
18 changes: 5 additions & 13 deletions samples/fleet_provisioning/mqtt5_fleet_provisioning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(IotIdentity-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::IotIdentity-cpp)
18 changes: 5 additions & 13 deletions samples/greengrass/basic_discovery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(Discovery-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::Discovery-cpp)
18 changes: 5 additions & 13 deletions samples/greengrass/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(GreengrassIpc-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::EventstreamRpc-cpp AWS::GreengrassIpc-cpp)
18 changes: 5 additions & 13 deletions samples/jobs/job_execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(IotJobs-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp AWS::IotJobs-cpp)
2 changes: 1 addition & 1 deletion samples/jobs/mqtt5_job_execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ find_package(IotJobs-cpp REQUIRED)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
Expand Down
18 changes: 5 additions & 13 deletions samples/mqtt/basic_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ endif ()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
18 changes: 5 additions & 13 deletions samples/mqtt/cognito_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ endif ()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
18 changes: 5 additions & 13 deletions samples/mqtt/custom_authorizer_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ endif ()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
18 changes: 5 additions & 13 deletions samples/mqtt/pkcs11_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,12 @@ endif()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
18 changes: 5 additions & 13 deletions samples/mqtt/pkcs12_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ endif ()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
18 changes: 5 additions & 13 deletions samples/mqtt/websocket_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ endif ()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
18 changes: 5 additions & 13 deletions samples/mqtt/windows_cert_connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,12 @@ endif ()

find_package(aws-crt-cpp REQUIRED)

if (UNIX AND NOT APPLE)
if (ENABLE_SANITIZERS AND UNIX AND NOT APPLE)
include(GNUInstallDirs)
elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")

if (${CMAKE_INSTALL_LIBDIR} STREQUAL "lib64")
set(FIND_LIBRARY_USE_LIB64_PATHS true)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake")
include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})
endif()

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

include(AwsSanitizers)
enable_language(C)
aws_add_sanitizers(${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} PRIVATE AWS::aws-crt-cpp)
Loading

0 comments on commit 18eacfd

Please sign in to comment.