2017-02-10 23:39:10 +00:00
#
# Setup the build type and compiler options.
#
# To set the build type, run the following command with a build type of DEBUG, RELEASE, or MINSIZEREL:
# cmake <path-to-source> -DCMAKE_BUILD_TYPE=<build-type>
#
# If no build type is specified by specifying it on the command line, default to debug.
if ( NOT CMAKE_BUILD_TYPE )
2017-07-18 22:25:37 +00:00
set ( CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: DEBUG, RELEASE, or MINSIZEREL." FORCE )
message ( "No build type specified, defaulting to Release." )
2017-02-10 23:39:10 +00:00
endif ( )
# Verify the build type is valid.
set ( buildTypes DEBUG RELEASE MINSIZEREL )
string ( TOUPPER "${CMAKE_BUILD_TYPE}" buildType )
list ( FIND buildTypes "${buildType}" buildTypeFound )
if ( buildTypeFound EQUAL -1 )
string ( LENGTH "${CMAKE_BUILD_TYPE}" buildTypeLen )
math ( EXPR buildTypePadLen "72 - ${buildTypeLen}" )
if ( buildTypePadLen GREATER 0 )
string ( RANDOM LENGTH "${buildTypePadLen}" ALPHABET " " buildTypePad )
endif ( )
message ( "###############################################################################" )
message ( "# #" )
message ( "# ERROR: #" )
message ( "# Unknown build type selected. Please select from DEBUG, RELEASE, or #" )
message ( "# MINSIZEREL. #" )
message ( "# #" )
message ( "# Build Type: #" )
message ( "# ${buildType}${buildTypePad}#" )
message ( "# #" )
message ( "###############################################################################" )
message ( FATAL_ERROR "Unknown build type ${buildType}. Please select from DEBUG, RELEASE, or MINSIZEREL. Quitting!" )
else ( )
2017-03-10 00:01:46 +00:00
message ( "Creating the build directory for the ${PROJECT_NAME} with build type: ${buildType}" )
2020-04-13 22:56:35 +00:00
# Print warning when building the SDK in DEBUG mode.
if ( buildType STREQUAL "DEBUG" )
message ( WARNING "WARNING! THIS DEVICE HAS BEEN COMPILED IN DEBUG MODE.\n\nRELEASING A PRODUCTION DEVICE IN DEBUG MODE MAY IMPACT DEVICE PERFORMANCE, DOES NOT COMPLY WITH THE AVS SECURITY REQUIREMENTS, AND COULD RESULT IN SUSPENSION OR TERMINATION OF THE ALEXA SERVICE ON YOUR DEVICES.\n\n" )
add_definitions ( "-DDEBUG_BUILD_TYPE" )
endif ( )
2017-02-10 23:39:10 +00:00
endif ( )
# Set up the compiler flags.
set ( CMAKE_CXX_STANDARD 11 )
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
set ( CMAKE_CXX_EXTENSIONS OFF )
# Determine the platform and compiler dependent flags.
2021-03-29 19:59:51 +00:00
if ( NOT MSVC )
2021-08-24 20:46:00 +00:00
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "-DDEBUG -DACSDK_LOG_ENABLED -DACSDK_DEBUG_LOG_ENABLED -Wall -Werror -Wsign-compare -g" )
2017-12-09 00:07:37 +00:00
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "-DNDEBUG -Wall -Werror -O2" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "-DNDEBUG -Wall -Werror -Os" )
Version 1.9.0 alexa-client-sdk
Changes in this update:
Enhancements
Added Android SDK support, which includes new implementations of the MediaPlayer, audio recorder, and logger.
Added the InteractionModel interface, which enables Alexa Routines.
Optional configuration changes have been introduced. Now a network interface can be specified to connect to the SDK via curl.
Build options can be configured to support Android.
Added GUI 1.1 support. The PlaybackController has been extended to support new control functionality, and the System interface has been updated to support SoftwareInfo.
Bug Fixes
Installation script execution time has been reduced. Now a single branch clone is used, such as the master branch.
Issue 846 - Fixed a bug where audio stuttered on slow network connections.
Removed the SpeakerManager constructor check for non-zero speakers.
Issue 891 - Resolved incorrect offset in the PlaybackFinished event.
Issue 727 - Fixed an issue where the sample app behaved erratically upon network disconnection/reconnection.
Issue 910 - Fixed a GCC 8+ compilation issue. Note: issues related to -Wclass-memaccess will still trigger warnings, but won't fail compilation.
Issue 871 Issue 880 - Fixed compiler warnings.
Fixed a bug where Ted Talks would not stream via TuneIn.
Fixed an issue where the PryonLiteKeywordDetector would not restart.
Fixed an issue where PlaybackStutterStarted and PlaybackStutterFinished events were not being sent due to a missing Gstreamer queue element.
Fixed a bug where the CapabilitiesDelegate database was not being cleared upon logout.
Fixed in issue that caused the following compiler warning “class has virtual functions but non-virtual destructor”.
Fixed a bug where BlueZDeviceManager was not properly destroyed.
Fixed a bug that occurred when the initializer list was converted to std::unordered_set.
Fixed a build error that occurred when building with BUILD_TESTING=Off.
Known Issues
* The ACL may encounter issues if audio attachments are received but not consumed.
* SpeechSynthesizerState currently uses GAINING_FOCUS and LOSING_FOCUS as a workaround for handling intermediate state. These states may be removed in a future release.
* The Alexa app doesn't always indicate when a device is successfully connected via Bluetooth.
* Connecting a product to streaming media via Bluetooth will sometimes stop media playback within the source application. Resuming playback through the source application or toggling next/previous will correct playback.
* When a source device is streaming silence via Bluetooth, the Alexa companion app indicates that audio content is streaming.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation is not yet supported.
* On some products, interrupted Bluetooth playback may not resume if other content is locally streamed.
* On Raspberry Pi, when streaming audio via Bluetooth, sometimes the audio stream stutters.
* These CapabilitiesDelegateTest tests have been temporarily disabled to prevent build errors for the Android build: CapabilitiesDelegateTest.withCapabilitiesHappyCase, CapabilitiesDelegateTest.republish, CapabilitiesDelegateTest.testClearData.
* make integration is currently not available for Android. In order to run integration tests on Android, you'll need to manually upload the test binary file along with the any input file. At that point, the adb can be used to run the integration tests.
* On Raspberry Pi running Android Things with HDMI output audio, beginning of speech is truncated when Alexa responds to user TTS.
* Spotify does not completely shut down when the sample app quits.
2018-08-28 21:10:18 +00:00
if ( CMAKE_COMPILER_IS_GNUCXX AND ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0" ) ) )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "${CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG} -Wno-error=class-memaccess" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "${CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE} -Wno-error=class-memaccess" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "${CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL} -Wno-error=class-memaccess" )
endif ( )
Version 1.17.0 alexa-client-sdk
Changes in this update:
**Enhancements**
- Added support for [captions for TTS](https://developer.amazon.com/docs/avs-device-sdk/features.html#captions). This enhancement allows you to print onscreen captions for Alexa voice responses.
- Added support for [SpeechSynthesizer Interface 1.3](https://developer.amazon.com/docs/alexa-voice-service/speechsynthesizer.html). This interface supports the new `captions` parameter.
- Added support for [AudioPlayer Interface 1.3](https://developer.amazon.com/docs/alexa-voice-service/audioplayer.html). This interface supports the new `captions` parameter.
- Added support for [Interaction Model 1.2](https://developer.amazon.com/docs/alexa-voice-service/interactionmodel-interface.html).
- Added support for [System 2.0](https://developer.amazon.com/en-US/docs/alexa/alexa-voice-service/system.html).
- Added support for Alarm Volume Ramp. This feature lets you to fade in alarms for a more pleasant experience. You enable alarm volume ramp in the sample app through the settings menu.
- Added support for using certified senders for URI path extensions. This change allows you to specify the URI path extension when sending messages with [`CertifiedSender::sendJSONMessage`](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1certified_sender_1_1_certified_sender.html#a4c0706d79717b226ba77d1a9c3280fe6).
- Added new [`Metrics`](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1_metrics.html) interfaces and helper classes. These additions help you create and consume [`Metrics`](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1_metrics.html) events.
- **Interfaces** - `MetricRecorderInterface`, `MetricSinkInterface`.
- **Helper Classes** - `DataPointStringBuilder`, `DataPointCounterBuilder`, `DataPointDurationBuilder`, `MetricEventBuilder`.
- Added support for the following AVS [endpoint](../avs-device-sdk/endpoints.html) controller capabilities:
- [Alexa.ModeController](https://developer.amazon.com/docs/alexa-voice-service/alexa-modecontroller.html)
- [Alexa.RangeController](https://developer.amazon.com/docs/alexa-voice-service/alexa-rangecontroller.html)
- [Alexa.PowerController](https://developer.amazon.com/docs/alexa-voice-service/alexa-powercontroller.html)
- [Alexa.ToggleController](https://developer.amazon.com/docs/alexa-voice-service/alexa-togglecontroller.html)
- Added `PowerResourceManagerInterface`. This interface allows the SDK to control power resource levels for components such as the `AudioInputProcessor` and `SpeechSynthesizer`.
- Added `AlexaInterfaceCapabilityAgent`. This Capability Agent handles common directives and endpoint controller capabilities support by [`Alexa.AlexaInterface`](../alexa-voice-service/alexa.html).
- Added `AlexaInterfaceMessageSenderInterface`. This interface is required to send common events defined by the `Alexa.AlexaInterface` interface.
- Added `BufferingComplete` to [`MediaPlayerObserverInterface`](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1avs_common_1_1utils_1_1media_player_1_1_media_player_observer_interface.html). This method helps improve performance in poor networking conditions by making sure `MediaPlayer` pre-buffers correctly.
- Added `SendDTMF` to `CallManagerInterface`. This method allows you to send DTMF tones during calls.
**New build options**
- CAPTIONS
- **ADDED** [`CAPTIONS`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#captions)
- **ADDED** [`LIBWEBVTT_LIB_PATH`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#captions)
- **ADDED** [`LIBWEBVTT_INCLUDE_DIR`](https://developer.amazon.com/docs//avs-device-sdk/cmake-parameters.html#captions)
- METRICS
- **ADDED** [`METRICS`](https://developer.amazon.com/docs//avs-device-sdk/cmake-parameters.html#metrics)
- ENDPONTS
- **ADDED** [`ENABLE_ALL_ENDPOINT_CONTROLLERS`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#endpoints)
- **ADDED** [`ENABLE_POWER_CONTROLLER`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#endpoints)
- **ADDED** [`ENABLE_TOGGLE_CONTROLLER`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#endpoints)
- **ADDED** [`ENABLE_RANGE_CONTROLLER`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#endpoints)
- **ADDED** [`ENABLE_MODE_CONTROLLER`](https://developer.amazon.com/docs/avs-device-sdk/cmake-parameters.html#endpoints)
**New dependencies**
- To use captions, you must install a [new dependency](https://developer.amazon.com/docs/avs-device-sdk/dependencies) – the [libwebvtt parsing library](https://github.com/alexa/webvtt). Webvtt is a C/C++ library for interpreting and authoring conformant WebVTT content. WebVTT is a caption and subtitle format designed for use with HTML5 audio and video elements.
**Bug fixes**
- Fixed [`MimeResponseSink::onReceiveNonMimeData`](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1acl_1_1_mime_response_sink.html) [data issue](https://github.com/alexa/avs-device-sdk/issues/1519) that returned invalid data.
- Fixed [data type issue](https://github.com/alexa/avs-device-sdk/issues/1519) that incorrectly used `finalResponseCode` instead of [`FinalResponseCodeId`](https://github.com/alexa/avs-device-sdk/blob/master/AVSCommon/Utils/src/LibcurlUtils/LibCurlHttpContentFetcher.cpp#L370).
- Fixed [`UrlContentToAttachmentConverter`](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1playlist_parser_1_1_url_content_to_attachment_converter.html) issue that used the incorrect range parameter.
- Fixed `FinallyGuard` [linking issue](https://github.com/alexa/avs-device-sdk/issues/1517) that caused problems compiling the SDK on iOS.
- Fixed a [Bluetooth Capability Agent](https://alexa.github.io/avs-device-sdk/classalexa_client_s_d_k_1_1capability_agents_1_1bluetooth_1_1_bluetooth.html) bug that prevented devices from initializing.
**Known Issues**
* The WebVTT dependency required for `captions` isn't supported for Windows/Android.
* Music playback history isn't displayed in the Alexa app for certain account and device types.
* When using Gnu Compiler Collection 8+ (GCC 8+), `-Wclass-memaccess` triggers warnings. You can ignore these, they don't cause the build to fail.
* Android error `libDefaultClient.so not found` might occur. Resolve this by upgrading to ADB version 1.0.40.
* If a device loses a network connection, the lost connection status isn't returned via local TTS.
* ACL encounters issues if it receives audio attachments but doesn't consume them.
* `SpeechSynthesizerState` uses `GAINING_FOCUS` and `LOSING_FOCUS` as a workaround for handling intermediate states.
* Media steamed through Bluetooth might abruptly stop. To restart playback, resume the media in the source application or toggle next/previous.
* If a connected Bluetooth device is inactive, the Alexa app might indicates that audio is playing.
* The Bluetooth agent assumes that the Bluetooth adapter is always connected to a power source. Disconnecting from a power source during operation isn't yet supported.
* When using some products, interrupted Bluetooth playback might not resume if other content is locally streamed.
* `make integration` isn't available for Android. To run Android integration tests, manually upload the test binary and input file and run ADB.
* Alexa might truncate the beginning of speech when responding to text-to-speech (TTS) user events. This only impacts Raspberry Pi devices running Android Things with HDMI output audio.
* A reminder TTS message doesn't play if the sample app restarts and loses a network connection. Instead, the default alarm tone plays twice.
* `ServerDisconnectIntegratonTest` tests are disabled until they are updated to reflect new service behavior.
* Bluetooth initialization must complete before connecting devices, otherwise devices are ignored.
* The `DirectiveSequencerTest.test_handleBlockingThenImmediatelyThenNonBockingOnSameDialogId` test fails intermittently.
* On some devices, Alexa gets stuck in a permanent listening state. Pressing `t` and `h` in the Sample App doesn't exit the listening state.
* Exiting the settings menu doesn't provide a message to indicate that you're back in the main menu.
2019-12-10 21:02:09 +00:00
if ( CMAKE_COMPILER_IS_GNUCXX AND ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0" ) ) )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "${CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG} -Wno-error=deprecated-copy" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "${CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE} -Wno-error=deprecated-copy" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "${CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL} -Wno-error=deprecated-copy" )
endif ( )
2021-03-29 19:59:51 +00:00
if ( MINGW )
2020-10-27 00:14:11 +00:00
# Debug build on MinGW needs O1 optimzation to reduce the code size. This is to get around GCC's string table overflow issue on MinGW.
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "${CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG} -O1 -fuse-ld=lld" )
2020-06-22 23:48:22 +00:00
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "${CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE} -fuse-ld=lld" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "${CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL} -fuse-ld=lld" )
endif ( )
2021-03-29 19:59:51 +00:00
else ( )
2021-08-24 20:46:00 +00:00
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "/DDEBUG /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -DACSDK_LOG_ENABLED -DACSDK_DEBUG_LOG_ENABLED /W4 /Zi /VZ /ZW /Od /MDd" )
2020-04-13 22:56:35 +00:00
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "/DNDEBUG /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /W4 /O2 /VZ /ZW /MD" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "/DNDEBUG /D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING /W4 /O1 /VZ /ZW /MD" )
add_definitions ( "-DNOMINMAX" )
add_definitions ( "-D_CRT_SECURE_NO_WARNINGS" )
set ( CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON )
add_definitions ( "-DWIN32_LEAN_AND_MEAN" )
2017-02-10 23:39:10 +00:00
endif ( )
2020-10-27 00:14:11 +00:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "${CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG} -Wconditional-uninitialized -Wsometimes-uninitialized -Wuninitialized" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "${CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE} -Wconditional-uninitialized -Wsometimes-uninitialized -Wuninitialized" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "${CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL} -Wconditional-uninitialized -Wsometimes-uninitialized -Wuninitialized" )
2021-03-29 19:59:51 +00:00
if ( MINGW )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG "${CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG} -Wno-error=sentinel" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE "${CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE} -Wno-error=sentinel" )
set ( CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL "${CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL} -Wno-error=sentinel" )
endif ( )
2020-10-27 00:14:11 +00:00
endif ( )
2017-02-10 23:39:10 +00:00
# Debug build, default.
2017-05-18 05:02:48 +00:00
set ( CMAKE_CXX_FLAGS_DEBUG "${CXX_PLATFORM_DEPENDENT_FLAGS_DEBUG} -DRAPIDJSON_HAS_STDSTRING" CACHE INTERNAL "Flags used for DEBUG builds" FORCE )
2017-02-10 23:39:10 +00:00
set ( CMAKE_C_FLAGS_DEBUG ${ CMAKE_CXX_FLAGS_DEBUG } CACHE INTERNAL "Flags used for DEBUG builds" FORCE )
# Release build.
2017-05-18 05:02:48 +00:00
set ( CMAKE_CXX_FLAGS_RELEASE "${CXX_PLATFORM_DEPENDENT_FLAGS_RELEASE} -DRAPIDJSON_HAS_STDSTRING" CACHE INTERNAL "Flags used for RELEASE builds" FORCE )
2017-02-10 23:39:10 +00:00
set ( CMAKE_C_FLAGS_RELEASE ${ CMAKE_CXX_FLAGS_RELEASE } CACHE INTERNAL "Flags used for RELEASE builds" FORCE )
# Minimum sized release build.
2017-05-18 05:02:48 +00:00
set ( CMAKE_CXX_FLAGS_MINSIZEREL "${CXX_PLATFORM_DEPENDENT_FLAGS_MINSIZEREL} -DRAPIDJSON_HAS_STDSTRING" CACHE INTERNAL "Flags used for minimum sized RELEASE builds" FORCE )
2017-02-10 23:39:10 +00:00
set ( CMAKE_C_FLAGS_MINSIZEREL ${ CMAKE_CXX_FLAGS_RELEASE } CACHE INTERNAL "Flags used for minimum sized RELEASE builds" FORCE )