Skip to content

Commit

Permalink
Add cmake flag for iot creds (#2056)
Browse files Browse the repository at this point in the history
* Add cmake flag for iot creds

* Remove the manual uncomment required line
  • Loading branch information
sirknightj authored Sep 18, 2024
1 parent df7f38b commit 096cafe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ project(KinesisVideoWebRTCClientSamples LANGUAGES C)

message("OPEN_SRC_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}")

if(IOT_CORE_ENABLE_CREDENTIALS)
add_definitions(-DIOT_CORE_ENABLE_CREDENTIALS)
message("Use IoT credentials in the samples")
endif()

if (WIN32)
if(NOT DEFINED PKG_CONFIG_EXECUTABLE)
if(EXISTS "C:\\gstreamer\\1.0\\x86_64\\bin\\pkg-config.exe")
Expand All @@ -17,7 +22,7 @@ if (WIN32)
message(FATAL_ERROR "Gstreamer not found in default path. Set the appropriate path with -DPKG_CONFIG_EXECUTABLE=<path>")
endif()
endif()

find_package(PkgConfig REQUIRED)

pkg_check_modules(GST gstreamer-1.0)
Expand Down
5 changes: 2 additions & 3 deletions samples/Samples.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,15 @@ extern "C" {

#define RTSP_PIPELINE_MAX_CHAR_COUNT 1000

/* To enable IoT credentials checks in the provided samples, specify
this through the CMake flag: cmake .. -DIOT_CORE_ENABLE_CREDENTIALS=ON */
#define IOT_CORE_CREDENTIAL_ENDPOINT ((PCHAR) "AWS_IOT_CORE_CREDENTIAL_ENDPOINT")
#define IOT_CORE_CERT ((PCHAR) "AWS_IOT_CORE_CERT")
#define IOT_CORE_PRIVATE_KEY ((PCHAR) "AWS_IOT_CORE_PRIVATE_KEY")
#define IOT_CORE_ROLE_ALIAS ((PCHAR) "AWS_IOT_CORE_ROLE_ALIAS")
#define IOT_CORE_THING_NAME ((PCHAR) "AWS_IOT_CORE_THING_NAME")
#define IOT_CORE_CERTIFICATE_ID ((PCHAR) "AWS_IOT_CORE_CERTIFICATE_ID")

/* Uncomment the following line in order to enable IoT credentials checks in the provided samples */
// #define IOT_CORE_ENABLE_CREDENTIALS 1

#define MASTER_DATA_CHANNEL_MESSAGE "This message is from the KVS Master"
#define VIEWER_DATA_CHANNEL_MESSAGE "This message is from the KVS Viewer"

Expand Down

0 comments on commit 096cafe

Please sign in to comment.