Skip to content

Commit

Permalink
Fix cmake in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Dec 2, 2024
1 parent d27eeaf commit 5c9a172
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 52 deletions.
18 changes: 5 additions & 13 deletions secure_tunneling/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(IotSecureTunneling-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::IotDeviceCommon-cpp AWS::IotSecureTunneling-cpp)
18 changes: 5 additions & 13 deletions servicetests/tests/FleetProvisioning/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 servicetests/tests/JobsExecution/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)
18 changes: 5 additions & 13 deletions servicetests/tests/ShadowUpdate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ find_package(IotShadow-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::IotShadow-cpp)

0 comments on commit 5c9a172

Please sign in to comment.