Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ option(UNIT_TESTING_MOCKS "wrap PAL functions with mock implementation for tests
option(TRANSPORT_PAHO "Build IoT Samples with Paho MQTT support" OFF)
option(PRECONDITIONS "Build SDK with preconditions enabled" ON)
option(LOGGING "Build SDK with logging support" ON)
option(STATIC_CRT "(MSVC only) Build SDK with static CRT" ON)

# disable preconditions when it's set to OFF
if (NOT PRECONDITIONS)
Expand Down Expand Up @@ -45,6 +46,17 @@ if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET)
endif()

project(az LANGUAGES C)

if (MSVC)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this MSVC only?

if (STATIC_CRT)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
Comment thread
antkmsft marked this conversation as resolved.
else()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd")
endif()
endif()

enable_testing ()

include(eng/cmake/global_compile_options.txt)
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ The following CMake options are available for adding/removing project features.
<td>This option can be set to any of the next values:<br>- No_value: default value is used and no_platform library is used.<br>- "POSIX": Provides implementation for Linux and Mac systems.<br>- "WIN32": Provides platform implementation for Windows based system<br>- "USER": Tells cmake to use an specific implementation provided by user. When setting this option, user must provide an implementation library and set option `AZ_USER_PLATFORM_IMPL_NAME` with the name of the library (i.e. <code>-DAZ_PLATFORM_IMPL=USER -DAZ_USER_PLATFORM_IMPL_NAME=user_platform_lib</code>). cmake will look for this library to link az_core</td>
<td>No_value</td>
</tr>
<tr>
<td>STATIC_CRT</td>
<td>This option has effect only when the MSVC compiler is used. It specifies whether the SDK should be built with the static (ON) or the dynamic (OFF) C runtime dependency.</td>
<td>ON</td>
</tr>
</table>

- ``Samples``: Storage Samples are built by default using the default PAL and HTTP adapter (see [running samples](#running-samples)). This means that running samples without building an HTTP transport adapter would throw errors like:
Expand Down
6 changes: 3 additions & 3 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
WindowsX86_Release_MapFiles_UnitTests:
OSVmImage: 'windows-2019'
vcpkg.deps: 'cmocka'
VCPKG_DEFAULT_TRIPLET: 'x86-windows-static-md'
VCPKG_DEFAULT_TRIPLET: 'x86-windows-static'
Comment thread
antkmsft marked this conversation as resolved.
build.args: '-DPRECONDITIONS=OFF -DUNIT_TESTING=ON -DLOGGING=OFF'
CMAKE_GENERATOR: 'Visual Studio 16 2019'
CMAKE_GENERATOR_PLATFORM: Win32
Expand Down Expand Up @@ -169,7 +169,7 @@ jobs:
Windows_Preconditions_UnitTests_Samples:
OSVmImage: 'windows-2019'
vcpkg.deps: 'curl[winssl] paho-mqtt cmocka'
VCPKG_DEFAULT_TRIPLET: 'x64-windows-static-md'
VCPKG_DEFAULT_TRIPLET: 'x64-windows-static'
build.args: '-DTRANSPORT_CURL=ON -DTRANSPORT_PAHO=ON -DAZ_PLATFORM_IMPL=WIN32 -DUNIT_TESTING=ON -DLOGGING=OFF'
CMAKE_GENERATOR: 'Visual Studio 16 2019'
CMAKE_GENERATOR_PLATFORM: x64
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
Windows_Release_MapFiles:
OSVmImage: 'windows-2019'
vcpkg.deps: ''
VCPKG_DEFAULT_TRIPLET: 'x64-windows-static-md'
VCPKG_DEFAULT_TRIPLET: 'x64-windows-static'
build.args: '-DPRECONDITIONS=OFF -DLOGGING=OFF'
CMAKE_GENERATOR: 'Visual Studio 16 2019'
CMAKE_GENERATOR_PLATFORM: x64
Expand Down