From 9080a6d5c623e87776c2e9abc8667908b3ee898e Mon Sep 17 00:00:00 2001 From: janbernloehr Date: Fri, 31 Jul 2020 10:41:46 +0200 Subject: [PATCH 1/6] Add CI --- .github/workflows/c-cpp.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..63fc83d --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,40 @@ +name: C/C++ CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + strategy: + matrix: + os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Run vcpkg + uses: lukka/run-vcpkg@v3 + with: + vcpkgArguments: 'curl openssl libuuid' + vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' + vcpkgGitCommitId: '2cb28482bb5f10332b3458502a3370f821b8f69c' + - name: Run CMake+Ninja + uses: lukka/run-cmake@v2 + with: + cmakeGenerator: 'Ninja' + cmakeListsOrSettingsJson: 'CMakeListsTxtAdvanced' + cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' + cmakeAppendedArgs: '-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/install' + buildWithCMakeArgs: '-t install' + useVcpkgToolchainFile: true + buildDirectory: '${{ runner.workspace }}/build' + env: + PKG_CONFIG_PATH: ${{ runner.workspace }}/b/vcpkg/installed/x64-linux/lib/pkgconfig + - uses: actions/upload-artifact@v2 + with: + name: azure-storage-cpplite + path: '${{ runner.workspace }}/install/**/*' From 9b3e63183faf9fda33e645ac195dc99596f8e972 Mon Sep 17 00:00:00 2001 From: pablorcum Date: Tue, 15 Sep 2020 13:13:56 +0200 Subject: [PATCH 2/6] Fixed crosscompiling on Windows. No PkgConfig dependency --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a6cc58..b0d89da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,7 @@ if (UNIX) list(APPEND EXTRA_LIBRARIES ${GNUTLS_LIBRARIES}) endif() - if(NOT APPLE) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL Linux) find_package(PkgConfig REQUIRED) pkg_check_modules(uuid REQUIRED IMPORTED_TARGET uuid) list(APPEND EXTRA_LIBRARIES PkgConfig::uuid) From 0a3cd8b798ec2e68ea223b3f5e13c08bd99f0124 Mon Sep 17 00:00:00 2001 From: pablorcum Date: Tue, 15 Sep 2020 13:19:52 +0200 Subject: [PATCH 3/6] Add support for OSSP uuid, required for QNX --- src/utility.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/utility.cpp b/src/utility.cpp index 538df8e..23bbae1 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -8,7 +8,11 @@ #define WIN32_LEAN_AND_MEAN #include #else +#ifdef __QNXNTO__ +#include // OSSP uuid +#else #include +#endif #include #include #include @@ -37,11 +41,19 @@ namespace azure { namespace storage_lite { res = std::string(uuid_cstr); RpcStringFreeA(reinterpret_cast(&uuid_cstr)); #else - uuid_t uuid; char uuid_cstr[37]; // 36 byte uuid plus null. - uuid_generate(uuid); - uuid_unparse(uuid, uuid_cstr); - res = std::string(uuid_cstr); + #ifdef __UUID_H__ + uuid_t *uuid; + uuid_create(&uuid); + uuid_make(uuid, UUID_MAKE_V1); + uuid_export(uuid, UUID_FMT_STR, &uuid_cstr, NULL); + uuid_destroy(uuid); + #else + uuid_t uuid; + uuid_generate(uuid); + uuid_unparse(uuid, uuid_cstr); + #endif + res = std::string(uuid_cstr); #endif return res; From 6c205907bb8c6cba41507ce4c95f5f536d4c631f Mon Sep 17 00:00:00 2001 From: pablorcum Date: Tue, 15 Sep 2020 15:01:07 +0200 Subject: [PATCH 4/6] Added windows CI workflow --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 63fc83d..333ea97 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest] + os: [windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest] runs-on: ${{ matrix.os }} From 0766ba5ff37ef526e5b3b75051d45888dfd762c4 Mon Sep 17 00:00:00 2001 From: pablorcum Date: Tue, 15 Sep 2020 15:25:11 +0200 Subject: [PATCH 5/6] Added vcpkg flag for x64-windows --- .github/workflows/c-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 333ea97..ffd7194 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -19,7 +19,7 @@ jobs: - name: Run vcpkg uses: lukka/run-vcpkg@v3 with: - vcpkgArguments: 'curl openssl libuuid' + vcpkgArguments: 'curl openssl libuuid --triplet x64-windows' vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' vcpkgGitCommitId: '2cb28482bb5f10332b3458502a3370f821b8f69c' - name: Run CMake+Ninja From 3c5d561e9c92ba1c6347158315b14c19821b2161 Mon Sep 17 00:00:00 2001 From: pablorcum Date: Tue, 15 Sep 2020 15:30:40 +0200 Subject: [PATCH 6/6] Reverted Windows CI workflow --- .github/workflows/c-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index ffd7194..63fc83d 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - os: [windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest] + os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest] runs-on: ${{ matrix.os }} @@ -19,7 +19,7 @@ jobs: - name: Run vcpkg uses: lukka/run-vcpkg@v3 with: - vcpkgArguments: 'curl openssl libuuid --triplet x64-windows' + vcpkgArguments: 'curl openssl libuuid' vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg' vcpkgGitCommitId: '2cb28482bb5f10332b3458502a3370f821b8f69c' - name: Run CMake+Ninja