

# CMake parameters for building the AWS SDK for C\$1\$1
<a name="cmake-params"></a>

Use the [CMake](https://cmake.org/) parameters listed in this section to customize how your SDK builds.

You can set these options with CMake GUI tools or the command line by using *-D*. For example:

```
cmake -DENABLE_UNITY_BUILD=ON -DREGENERATE_CLIENTS=1
```

## General CMake Variables and Options
<a name="cmake-general-options"></a>

The following are general ** `cmake` ** variables and options that affect the build process of the SDK source code. 

**Note**  
Use these parameters when building the SDK source code for the SDK for C\$1\$1 itself.

**Topics**
+ [ADD\$1CUSTOM\$1CLIENTS](#cmake-add-custom-clients)
+ [AUTORUN\$1UNIT\$1TESTS](#cmake-AUTORUN_UNIT_TESTS)
+ [AWS\$1AUTORUN\$1LD\$1LIBRARY\$1PATH](#cmake-AWS_AUTORUN_LD_LIBRARY_PATH)
+ [AWS\$1SDK\$1WARNINGS\$1ARE\$1ERRORS](#cmake-AWS_SDK_WARNINGS_ARE_ERRORS)
+ [AWS\$1USE\$1CRYPTO\$1SHARED\$1LIBS](#cmake-use-crypto)
+ [AWS\$1TEST\$1REGION](#cmake-AWS_TEST_REGION)
+ [BUILD\$1BENCHMARKS](#cmake-BUILD_BENCHMARKS)
+ [BUILD\$1DEPS](#cmake-BUILD_DEPS)
+ [BUILD\$1ONLY](#cmake-build-only)
+ [BUILD\$1OPTEL](#cmake-BUILD_OPTEL)
+ [BUILD\$1SHARED\$1LIBS](#cmake-build-shared-libs)
+ [BYPASS\$1DEFAULT\$1PROXY](#cmake-BYPASS_DEFAULT_PROXY)
+ [CPP\$1STANDARD](#cmake-cpp-standard)
+ [CURL\$1INCLUDE\$1DIR](#cmake-curl-include-dir)
+ [CURL\$1LIBRARY](#cmake-curl-library)
+ [CUSTOM\$1MEMORY\$1MANAGEMENT](#cmake-custom-memory-management)
+ [DISABLE\$1INTERNAL\$1IMDSV1\$1CALLS](#cmake-DISABLE_INTERNAL_IMDSV1_CALLS)
+ [ENABLE\$1ADDRESS\$1SANITIZER](#cmake-ENABLE_ADDRESS_SANITIZER)
+ [ENABLE\$1CURL\$1LOGGING](#cmake-enable-curl-logging)
+ [ENABLE\$1HTTP\$1CLIENT\$1TESTING](#cmake-ENABLE_HTTP_CLIENT_TESTING)
+ [ENABLE\$1RTTI](#cmake-enable-rtti)
+ [ENABLE\$1TESTING](#cmake-enable-testing)
+ [ENABLE\$1UNITY\$1BUILD](#cmake-enable-unity-build)
+ [ENABLE\$1VIRTUAL\$1OPERATIONS](#cmake-virtual-op)
+ [ENABLE\$1ZLIB\$1REQUEST\$1COMPRESSION](#cmake-ENABLE_ZLIB_REQUEST_COMPRESSION)
+ [FORCE\$1CURL](#cmake-force-curl)
+ [FORCE\$1SHARED\$1CRT](#cmake-force-shared-crt)
+ [G](#cmake-g)
+ [MINIMIZE\$1SIZE](#cmake-minimize-size)
+ [NO\$1ENCRYPTION](#cmake-no-encryption)
+ [NO\$1HTTP\$1CLIENT](#cmake-no-http-client)
+ [REGENERATE\$1CLIENTS](#cmake-regenerate-clients)
+ [REGENERATE\$1DEFAULTS](#cmake-regenerate-defaults)
+ [SIMPLE\$1INSTALL](#cmake-simple-install)
+ [TARGET\$1ARCH](#cmake-target-arch)
+ [USE\$1CRT\$1HTTP\$1CLIENT](#cmake-USE_CRT_HTTP_CLIENT)
+ [USE\$1IXML\$1HTTP\$1REQUEST\$12](#cmake-USE_IXML_HTTP_REQUEST_2)
+ [USE\$1OPENSSL](#cmake-use-openssl)
+ [USE\$1TLS\$1V1\$12](#cmake-USE_TLS_V1_2)
+ [USE\$1TLS\$1V1\$13](#cmake-USE_TLS_V1_3)

### ADD\$1CUSTOM\$1CLIENTS
<a name="cmake-add-custom-clients"></a>

Builds any arbitrary clients based on the API definition. Place your definition in the `code-generation/api-definitions` folder, and then pass this argument to ** `cmake` **. The ** `cmake` ** configure step generates your client and includes it as a subdirectory in your build. This is particularly useful to generate a C\$1\$1 client for using one of your [API Gateway](https://aws.amazon.com/api-gateway) services. For example:

```
-DADD_CUSTOM_CLIENTS="serviceName=myCustomService,version=2015-12-21;serviceName=someOtherService,version=2015-08-15"
```

**Note**  
To use the `ADD_CUSTOM_CLIENTS` parameter, you must have [Python 2.7](https://www.python.org/downloads/), Java ([JDK 1.8\$1](http://openjdk.java.net/install/)), and [Maven](https://maven.apache.org/) installed and in your `PATH`.

### AUTORUN\$1UNIT\$1TESTS
<a name="cmake-AUTORUN_UNIT_TESTS"></a>

If `ON`, run unit tests automatically after building.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### AWS\$1AUTORUN\$1LD\$1LIBRARY\$1PATH
<a name="cmake-AWS_AUTORUN_LD_LIBRARY_PATH"></a>

The path to append into LD\$1LIBRARY\$1PATH for unit tests autorun by CMake. Set this path if custom runtime libraries are required for overridden dependencies.

Values  
 *String.* 

Default  
 *N/A* 

### AWS\$1SDK\$1WARNINGS\$1ARE\$1ERRORS
<a name="cmake-AWS_SDK_WARNINGS_ARE_ERRORS"></a>

If `ON`, treat compiler warnings as errors. Try turning this `OFF` if observing errors on a new or uncommon compiler.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### AWS\$1USE\$1CRYPTO\$1SHARED\$1LIBS
<a name="cmake-use-crypto"></a>

Forces FindCrypto to use a shared crypto library if found. Turn this `OFF` to use [BUILD\$1SHARED\$1LIBS](#cmake-build-shared-libs)'s setting instead.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### AWS\$1TEST\$1REGION
<a name="cmake-AWS_TEST_REGION"></a>

The AWS Region to use for integration tests.

Values  
 *String.* 

Default  
 *N/A* 

### BUILD\$1BENCHMARKS
<a name="cmake-BUILD_BENCHMARKS"></a>

If `ON`, build the benchmark executable.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### BUILD\$1DEPS
<a name="cmake-BUILD_DEPS"></a>

If `ON`, build third-party dependencies.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### BUILD\$1ONLY
<a name="cmake-build-only"></a>

Builds only the clients you want to use. If set to a high-level SDK such as `aws-cpp-sdk-transfer`, *BUILD\$1ONLY* resolves any low-level client dependencies. It also builds integration and unit tests related to the projects you select, if they exist. This is a list argument, with values separated by semicolon (`;`) characters. For example:

```
-DBUILD_ONLY="s3;cognito-identity"
```

**Note**  
The core SDK module, `aws-sdk-cpp-core`, is *always* built, regardless of the value of the *BUILD\$1ONLY* parameter.

### BUILD\$1OPTEL
<a name="cmake-BUILD_OPTEL"></a>

If `ON`, builds the open telemetry implementation of tracing.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### BUILD\$1SHARED\$1LIBS
<a name="cmake-build-shared-libs"></a>

A built-in CMake option, re-exposed here for visibility. If `ON`, it builds shared libraries; otherwise, it builds only static libraries.

**Note**  
To dynamically link to the SDK, you must define the `USE_IMPORT_EXPORT` symbol for all build targets using the SDK.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### BYPASS\$1DEFAULT\$1PROXY
<a name="cmake-BYPASS_DEFAULT_PROXY"></a>

If `ON`, bypass the machine's default proxy settings when using IXmlHttpRequest2.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### CPP\$1STANDARD
<a name="cmake-cpp-standard"></a>

Specifies a custom C\$1\$1 standard for use with C\$1\$1 14 and 17 code bases.

Values  
 *11* \$1 *14* \$1 *17* 

Default  
 *11* 

### CURL\$1INCLUDE\$1DIR
<a name="cmake-curl-include-dir"></a>

Path to curl include directory containing `libcurl` headers.

Values  
 *String path to selected `include` directory. For example, `D:/path/to/dir/with/curl/include`.* 

Default  
 *N/A* 

### CURL\$1LIBRARY
<a name="cmake-curl-library"></a>

Path to curl library file to link against. This library can be a static library or an import library, depending on the needs of your application.

Values  
 *String path to the curl library file. For example, `D:/path/to/static/libcur/file/ie/libcurl.lib.a`.* 

Default  
 *N/A* 

### CUSTOM\$1MEMORY\$1MANAGEMENT
<a name="cmake-custom-memory-management"></a>

To use a custom memory manager, set the value to `1`. You can install a custom allocator so that all STL types use the custom allocation interface. If you set the value `0`, you still might want to use the STL template types to help with DLL safety on Windows.

If static linking is `ON`, custom memory management defaults to *off* (`0`). If dynamic linking is `ON`, custom memory management defaults to *on* (`1`) and avoids cross-DLL allocation and deallocation.

**Note**  
To prevent linker mismatch errors, you must use the same value (`0` or `1`) throughout your build system.

To install your own memory manager to handle allocations made by the SDK, you must set `-DCUSTOM_MEMORY_MANAGEMENT` and define `USE_AWS_MEMORY_MANAGEMENT` for all build targets that depend on the SDK.

### DISABLE\$1INTERNAL\$1IMDSV1\$1CALLS
<a name="cmake-DISABLE_INTERNAL_IMDSV1_CALLS"></a>

If `ON`, no internal calls are made to the V1 API of the [Instance Metadata Service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). If `OFF`, IMDSv2 calls will fallback to using IMDSv1 if the IMDSv2 call fails. For more information on IMDSv1 and IMDSv2, see [Use the Instance Metadata Service to access instance metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html) in the *Amazon EC2 User Guide*.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### ENABLE\$1ADDRESS\$1SANITIZER
<a name="cmake-ENABLE_ADDRESS_SANITIZER"></a>

If `ON`, turns on Address Sanitizer for gcc or clang.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### ENABLE\$1CURL\$1LOGGING
<a name="cmake-enable-curl-logging"></a>

If `ON`, pipe the internal log for curl to the SDK logger.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### ENABLE\$1HTTP\$1CLIENT\$1TESTING
<a name="cmake-ENABLE_HTTP_CLIENT_TESTING"></a>

If `ON`, build and run corresponding HTTP client test suites.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### ENABLE\$1RTTI
<a name="cmake-enable-rtti"></a>

Controls whether the SDK is built to enable run-time type information (RTTI).

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### ENABLE\$1TESTING
<a name="cmake-enable-testing"></a>

Controls whether unit and integration test projects are built during the SDK build.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### ENABLE\$1UNITY\$1BUILD
<a name="cmake-enable-unity-build"></a>

If `ON`, most SDK libraries are built as a single, generated `.cpp` file. This can significantly reduce static library size and speed up compilation time.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### ENABLE\$1VIRTUAL\$1OPERATIONS
<a name="cmake-virtual-op"></a>

This parameter usually works together with `REGENERATE_CLIENTS` for code generation. 

If `ENABLE_VIRTUAL_OPERATIONS` is `ON` and `REGENERATE_CLIENTS` is `ON`, operation-related functions in service clients will be marked as `virtual`.

If `ENABLE_VIRTUAL_OPERATIONS` is `OFF` and `REGENERATE_CLIENTS` is `ON`, `virtual` won't be added to operation functions and service client classes will be marked as `final`.

If `ENABLE_VIRTUAL_OPERATIONS` is `OFF`, the SDK will also add `-ffunction-sections` and `-fdata-sections` compiler flags for gcc and clang when compiling.

For more information, see [CMake Parameters](https://github.com/aws/aws-sdk-cpp/blob/main/docs/CMake_Parameters.md#enable_virtual_operations) on GitHub. 

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### ENABLE\$1ZLIB\$1REQUEST\$1COMPRESSION
<a name="cmake-ENABLE_ZLIB_REQUEST_COMPRESSION"></a>

For services that support it, request content will be compressed. On by default if dependency is available.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### FORCE\$1CURL
<a name="cmake-force-curl"></a>

Windows only. If `ON`, forces usage of the curl client instead of the default [WinHTTP](https://msdn.microsoft.com/en-us/library/windows/desktop/aa382925%28v=vs.85%29.aspx) data transfer provider.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### FORCE\$1SHARED\$1CRT
<a name="cmake-force-shared-crt"></a>

If `ON`, the SDK links to the C runtime *dynamically*; otherwise, it uses the *BUILD\$1SHARED\$1LIBS* setting (sometimes necessary for backward compatibility with earlier versions of the SDK).

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### G
<a name="cmake-g"></a>

Generates build artifacts, such as Visual Studio solutions and Xcode projects.

For example, on Windows:

```
-G "Visual Studio 12 Win64"
```

For more information, see the CMake documentation for your platform.

### MINIMIZE\$1SIZE
<a name="cmake-minimize-size"></a>

A superset of [ENABLE\$1UNITY\$1BUILD](#cmake-enable-unity-build). If `ON`, this option turns on *ENABLE\$1UNITY\$1BUILD* and additional binary size reduction settings.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### NO\$1ENCRYPTION
<a name="cmake-no-encryption"></a>

If `ON`, prevents the default platform-specific cryptography implementation from being built into the library. Turn this *ON* to inject your own cryptography implementation.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### NO\$1HTTP\$1CLIENT
<a name="cmake-no-http-client"></a>

If `ON`, prevents the default platform-specific HTTP client from being built into the library. If *ON*, you will need to provide your own platform-specific HTTP client implementation.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### REGENERATE\$1CLIENTS
<a name="cmake-regenerate-clients"></a>

If `ON`, this parameter deletes all generated code and generates the client directories from the `code-generation/api-definitions` folder. For example:

```
-DREGENERATE_CLIENTS=1
```

**Note**  
To use the `REGENERATE_CLIENTS` parameter, you must have [Python 2.7](https://www.python.org/downloads/), Java ([JDK 1.8\$1](http://openjdk.java.net/install/)), and [Maven](https://maven.apache.org/) installed and in your `PATH`.

### REGENERATE\$1DEFAULTS
<a name="cmake-regenerate-defaults"></a>

If `ON`, this parameter deletes all generated defaults code and generates it again from the `code-generation/defaults` folder. For example:

```
-DREGENERATE_DEFAULTS=1
```

**Note**  
To use the `REGENERATE_DEFAULTS` parameter, you must have [Python 2.7](https://www.python.org/downloads/), Java ([JDK 1.8\$1](http://openjdk.java.net/install/)), and [Maven](https://maven.apache.org/) installed and in your `PATH`.

### SIMPLE\$1INSTALL
<a name="cmake-simple-install"></a>

If `ON`, the install process does not insert platform-specific intermediate directories underneath `bin/` and `lib/`. Turn `OFF` if you need to make multiplatform releases under a single install directory.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### TARGET\$1ARCH
<a name="cmake-target-arch"></a>

To cross-compile or build for a mobile platform, you must specify the target platform. By default, the build detects the host operating system and builds for the detected operating system.

**Note**  
When *TARGET\$1ARCH* is *ANDROID*, additional options are available. See [Android CMake Variables and Options](#cmake-android-variables).

Values  
 *WINDOWS* \$1 *LINUX* \$1 *APPLE* \$1 *ANDROID* 

### USE\$1CRT\$1HTTP\$1CLIENT
<a name="cmake-USE_CRT_HTTP_CLIENT"></a>

If `ON`, use the common runtime HTTP client, and the legacy systems such as WinHttp and libcurl are not built or included.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### USE\$1IXML\$1HTTP\$1REQUEST\$12
<a name="cmake-USE_IXML_HTTP_REQUEST_2"></a>

Windows only. If `ON`, use the com object IXmlHttpRequest2 for the HTTP stack.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### USE\$1OPENSSL
<a name="cmake-use-openssl"></a>

If `ON`, the SDK builds using OpenSSL; otherwise, it uses [https://github.com/awslabs/aws-lc](https://github.com/awslabs/aws-lc). `AWS-LC` is a general-purpose cryptographic library maintained by the AWS Cryptography team for AWS and their customers. Turning `OFF` the parameter installs `AWS-LC` as replacement of OpenSSL in the system default directory. Don't use if you already have an OpenSSL installation in your system.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### USE\$1TLS\$1V1\$12
<a name="cmake-USE_TLS_V1_2"></a>

If `ON`, the HTTP client enforces TLS 1.2.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### USE\$1TLS\$1V1\$13
<a name="cmake-USE_TLS_V1_3"></a>

If `ON`, the HTTP client enforces TLS 1.3.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

## Android CMake Variables and Options
<a name="cmake-android-variables"></a>

Use the following variables when you are creating an Android build of the SDK (when [TARGET\$1ARCH](#cmake-target-arch) is set to *ANDROID*).

**Topics**
+ [ANDROID\$1ABI](#cmake-android-abi)
+ [ANDROID\$1BUILD\$1CURL](#cmake-ANDROID_BUILD_CURL)
+ [ANDROID\$1BUILD\$1OPENSSL](#cmake-ANDROID_BUILD_OPENSSL)
+ [ANDROID\$1BUILD\$1ZLIB](#cmake-ANDROID_BUILD_ZLIB)
+ [ANDROID\$1NATIVE\$1API\$1LEVEL](#cmake-android-native-api-level)
+ [ANDROID\$1STL](#cmake-android-stl)
+ [ANDROID\$1TOOLCHAIN\$1NAME](#cmake-android-toolchain-name)
+ [DISABLE\$1ANDROID\$1STANDALONE\$1BUILD](#cmake-disable-android-standalone-build)
+ [NDK\$1DIR](#cmake-ndk-dir)

### ANDROID\$1ABI
<a name="cmake-android-abi"></a>

Android only. Controls which Application Binary Interface (ABI) to output code for.

**Note**  
Not all valid Android ABI values are currently supported.

Values  
 *arm64* \$1 *armeabi-v7a* \$1 *x86\$164* \$1 *x86* \$1 *mips64* \$1 *mips* 

Default  
 *armeabi-v7a* 

### ANDROID\$1BUILD\$1CURL
<a name="cmake-ANDROID_BUILD_CURL"></a>

Android only. If `ON`, build curl also. 

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### ANDROID\$1BUILD\$1OPENSSL
<a name="cmake-ANDROID_BUILD_OPENSSL"></a>

Android only. If `ON`, build Openssl also.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### ANDROID\$1BUILD\$1ZLIB
<a name="cmake-ANDROID_BUILD_ZLIB"></a>

Android only. If `ON`, build Zlib also.

Values  
 *ON* \$1 *OFF* 

Default  
 *ON* 

### ANDROID\$1NATIVE\$1API\$1LEVEL
<a name="cmake-android-native-api-level"></a>

Android only. Controls what API level the SDK builds against. If you set [ANDROID\$1STL](#cmake-android-stl) to *gnustl*, you can choose any API level. If you use *libc\$1\$1*, you must use an API level of at least *21*.

Default  
Varies by STL choice.

### ANDROID\$1STL
<a name="cmake-android-stl"></a>

Android only. Controls what flavor of the C\$1\$1 standard library the SDK uses.

**Important**  
Performance problems can occur within the SDK if the `gnustl` options are used; we strongly recommend using *libc\$1\$1\$1shared* or *libc\$1\$1\$1static*.

Values  
 *libc\$1\$1\$1shared* \$1 *libc\$1\$1\$1static* \$1 *gnustl\$1shared* \$1 *gnustl\$1static* 

Default  
 *libc\$1\$1\$1shared* 

### ANDROID\$1TOOLCHAIN\$1NAME
<a name="cmake-android-toolchain-name"></a>

Android only. Controls which compiler is used to build the SDK.

**Note**  
With GCC being deprecated by the Android NDK, we recommend using the default value.

Default  
 *standalone-clang* 

### DISABLE\$1ANDROID\$1STANDALONE\$1BUILD
<a name="cmake-disable-android-standalone-build"></a>

Android only. By default, Android builds use a standalone clang-based toolchain constructed via NDK scripts. To use your own toolchain, turn this option *ON*.

Values  
 *ON* \$1 *OFF* 

Default  
 *OFF* 

### NDK\$1DIR
<a name="cmake-ndk-dir"></a>

Android only. Specifies an override path where the build system should find the Android NDK. By default, the build system checks environment variables (`ANDROID_NDK`) if this variable is not set.