From 486cb3538db0723d67afd8ab5f191f5695a77ca7 Mon Sep 17 00:00:00 2001 From: Niyati Maheshwari Date: Tue, 24 Oct 2023 15:11:25 -0700 Subject: [PATCH] GitHub Actions CI enhancements (#1063) * try fixing running cmake twice * try a different cpath * update cc, cxx, ldflags, cpath * remove CC and CXX * try /usr/bin/clang and /Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld * -L/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/lib/ * specify host for log4cplus * don't install logcplus with brew * try using clang 14 * add missing space * don't set cc and cxx * configure CMAKE_OSX_SYSROOT before creating the configure command * try ldflags and paths with cmake fix * remove prefix from configure_command * update ldflags * fix install * rearrange * put back configure * put back host in cmake instruction * PREFIX /build * try using source_dir * remove source_dir * move back prefix * put back flags * only remove prefix from configure_command * missing space * if (APPLE) * install * check compiler * use '' STREQUAL * check clang compiler * osxsysroot * Add back osx_sysroot * remove space from libcurl * project(log4cplus-download NONE) to fix gcc * try LANGUAGES CPP) in all cmake files * try C) * try CXX * fix ubuntu build --- .github/workflows/ci.yml | 10 ++++++---- .gitignore | 1 + CMake/Dependencies/libautoconf-CMakeLists.txt | 2 +- CMake/Dependencies/libautomake-CMakeLists.txt | 2 +- CMake/Dependencies/libcurl-CMakeLists.txt | 2 +- CMake/Dependencies/libgtest-CMakeLists.txt | 2 +- CMake/Dependencies/libjsmn-CMakeLists.txt | 2 +- CMake/Dependencies/libkvscproducer-CMakeLists.txt | 2 +- CMake/Dependencies/liblog4cplus-CMakeLists.txt | 5 ++++- CMake/Dependencies/libopenssl-CMakeLists.txt | 2 +- 10 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ad1462ec..b93c5300 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,10 @@ jobs: runs-on: macos-11 env: AWS_KVS_LOG_LEVEL: 2 + CC: /usr/bin/clang + CXX: /usr/bin/clang++ + LDFLAGS: -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib + CPATH: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ permissions: id-token: write contents: read @@ -22,12 +26,12 @@ jobs: uses: actions/checkout@v3 - name: Install dependencies run: | - brew install pkg-config openssl cmake gstreamer log4cplus + brew install pkg-config openssl cmake gstreamer brew unlink openssl - name: Build repository run: | mkdir build && cd build - sh -c 'cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE;cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE -DCMAKE_INSTALL_PREFIX=.' + cmake .. -DBUILD_TEST=TRUE -DCOMPILER_WARNINGS=TRUE -DCMAKE_INSTALL_PREFIX=. make make install - name: Configure AWS Credentials @@ -243,8 +247,6 @@ jobs: runs-on: ubuntu-20.04 env: AWS_KVS_LOG_LEVEL: 2 - CC: gcc - CXX: g++ permissions: id-token: write contents: read diff --git a/.gitignore b/.gitignore index b4dc61e3..18dc553d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ open-source/libusrsctp open-source/libwebsockets open-source/local open-source/libautoconf +open-source/liblog4cplus outputs tags dependency diff --git a/CMake/Dependencies/libautoconf-CMakeLists.txt b/CMake/Dependencies/libautoconf-CMakeLists.txt index a4544aff..2d93e425 100644 --- a/CMake/Dependencies/libautoconf-CMakeLists.txt +++ b/CMake/Dependencies/libautoconf-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libautoconf-download NONE) +project(libautoconf-download LANGUAGES CXX) find_program(MAKE_EXE NAMES make) diff --git a/CMake/Dependencies/libautomake-CMakeLists.txt b/CMake/Dependencies/libautomake-CMakeLists.txt index 8544a16f..985509e0 100644 --- a/CMake/Dependencies/libautomake-CMakeLists.txt +++ b/CMake/Dependencies/libautomake-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libautomake-download NONE) +project(libautomake-download LANGUAGES CXX) find_program(MAKE_EXE NAMES make) diff --git a/CMake/Dependencies/libcurl-CMakeLists.txt b/CMake/Dependencies/libcurl-CMakeLists.txt index fc2398d8..458d2333 100644 --- a/CMake/Dependencies/libcurl-CMakeLists.txt +++ b/CMake/Dependencies/libcurl-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libcurl-download NONE) +project(libcurl-download LANGUAGES CXX) find_program(MAKE_EXE NAMES make) diff --git a/CMake/Dependencies/libgtest-CMakeLists.txt b/CMake/Dependencies/libgtest-CMakeLists.txt index db88fda4..1e55b44f 100644 --- a/CMake/Dependencies/libgtest-CMakeLists.txt +++ b/CMake/Dependencies/libgtest-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libgtest-download NONE) +project(libgtest-download LANGUAGES CXX) include(ExternalProject) diff --git a/CMake/Dependencies/libjsmn-CMakeLists.txt b/CMake/Dependencies/libjsmn-CMakeLists.txt index b16ca0f5..9e89d445 100644 --- a/CMake/Dependencies/libjsmn-CMakeLists.txt +++ b/CMake/Dependencies/libjsmn-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libjsmn-download NONE) +project(libjsmn-download LANGUAGES CXX) include(ExternalProject) ExternalProject_Add(project_libjsmn diff --git a/CMake/Dependencies/libkvscproducer-CMakeLists.txt b/CMake/Dependencies/libkvscproducer-CMakeLists.txt index be0eece1..cc301ec6 100644 --- a/CMake/Dependencies/libkvscproducer-CMakeLists.txt +++ b/CMake/Dependencies/libkvscproducer-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libkvscproducer-download NONE) +project(libkvscproducer-download LANGUAGES CXX) include(ExternalProject) diff --git a/CMake/Dependencies/liblog4cplus-CMakeLists.txt b/CMake/Dependencies/liblog4cplus-CMakeLists.txt index 54fc8a88..30daefa9 100644 --- a/CMake/Dependencies/liblog4cplus-CMakeLists.txt +++ b/CMake/Dependencies/liblog4cplus-CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.6.3) find_program(MAKE_EXE NAMES make) -project(log4cplus-download NONE) +project(log4cplus-download LANGUAGES CXX) set(BUILD_SHARED_LIBS 1) if (BUILD_STATIC) @@ -19,6 +19,9 @@ if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -isysroot${CMAKE_OSX_SYSROOT}") endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + SET(CONFIGURE_COMMAND ${CONFIGURE_STATIC}) +endif() include(ExternalProject) diff --git a/CMake/Dependencies/libopenssl-CMakeLists.txt b/CMake/Dependencies/libopenssl-CMakeLists.txt index bf4edca2..cd778d6e 100644 --- a/CMake/Dependencies/libopenssl-CMakeLists.txt +++ b/CMake/Dependencies/libopenssl-CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6.3) -project(libopenssl-download NONE) +project(libopenssl-download LANGUAGES CXX) if (WIN32) find_program(MAKE_EXE NAMES nmake)