Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/azure/azure-c-shared-utility
Azure C SDKs common code
https://github.com/azure/azure-c-shared-utility
azure c cmake general-purpose library
Last synced: 2 days ago
JSON representation
Azure C SDKs common code
- Host: GitHub
- URL: https://github.com/azure/azure-c-shared-utility
- Owner: Azure
- License: other
- Created: 2015-10-26T17:53:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-21T01:45:49.000Z (8 months ago)
- Last Synced: 2024-12-27T22:14:59.751Z (10 days ago)
- Topics: azure, c, cmake, general-purpose, library
- Language: C
- Homepage:
- Size: 10.9 MB
- Stars: 109
- Watchers: 60
- Forks: 204
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.MD
Awesome Lists containing this project
README
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
# Azure C Shared Utility
azure-c-shared-utility is a C library providing common functionality for basic tasks (like string, list manipulation, IO, etc.).
## Dependencies
azure-c-shared-utility provides 3 tlsio implementations:
- tlsio_schannel - runs only on Windows
- tlsio_openssl - depends on OpenSSL being installed
- tlsio_wolfssl - depends on WolfSSL being installedazure-c-shared-utility depends on curl for HTTPAPI for Linux.
azure-c-shared-utility uses cmake for configuring build files.
## Setup
1. Clone **azure-c-shared-utility** using the recursive option:
```
git clone --recursive https://github.com/Azure/azure-c-shared-utility.git
```2. Create a folder called *cmake* under *azure-c-shared-utility*
3. Switch to the *cmake* folder and run
```
cmake ..
```4. Build
```
cmake --build .
```### Installation and Use
Optionally, you may choose to install azure-c-shared-utility on your machine:1. Switch to the *cmake* folder and run
```
cmake -Duse_installed_dependencies=ON ../
```
```
cmake --build . --target install
```or install using the follow commands for each platform:
On Linux:
```
sudo make install
```On Windows:
```
msbuild /m INSTALL.vcxproj
```2. Use it in your project (if installed)
```
find_package(azure_c_shared_utility REQUIRED CONFIG)
target_link_library(yourlib aziotsharedutil)
```_If running tests, this requires that umock-c, azure-ctest, and azure-c-testrunnerswitcher are installed (through CMake) on your machine._
### Building the tests
In order to build the tests use:
```
cmake .. -Drun_unittests:bool=ON
```## Configuration options
In order to turn on/off the tlsio implementations use the following CMAKE options:
* `-Duse_schannel:bool={ON/OFF}` - turns on/off the SChannel support
* `-Duse_openssl:bool={ON/OFF}` - turns on/off the OpenSSL support. If this option is used, an environment variable named OpenSSLDir should be set to point to the OpenSSL folder.
* `-Duse_wolfssl:bool={ON/OFF}` - turns on/off the WolfSSL support. If this option is used, an environment variable named WolfSSLDir should be set to point to the WolfSSL folder.
* `-Duse_http:bool={ON/OFF}` - turns on/off the HTTP API support.
* `-Duse_installed_dependencies:bool={ON/OFF}` - turns on/off building azure-c-shared-utility using installed dependencies. This package may only be installed if this flag is ON.
* `-Drun_unittests:bool={ON/OFF}` - enables building of unit tests. Default is OFF.
* `-Duse_default_uuid:bool={ON/OFF}` - use the out-of-the-box UUID implementation that comes with the SDK rather than platform specific implementations. Default is OFF.
* `-Dno_openssl_engine:bool={ON/OFF}` - disables the use of ENGINEs in OpenSSL. Default is OFF.## Porting to new devices
Instructions for porting the Azure IoT C SDK to new devices are located
[here](https://github.com/Azure/azure-c-shared-utility/blob/master/devdoc/porting_guide.md).