From 8fe396d89009e21ef708cd61508a6ac27ad55b9d Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 18 Jul 2021 14:57:00 +0200 Subject: [PATCH 1/3] Fix -Wundef warnings in iOS build Make sure is always included in macOS/iOS build. --- include/wx/platform.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/wx/platform.h b/include/wx/platform.h index 7572c84162..c2449a2a57 100644 --- a/include/wx/platform.h +++ b/include/wx/platform.h @@ -415,6 +415,7 @@ #ifdef __WXOSX__ /* setup precise defines according to sdk used */ # include +# include # if defined(__WXOSX_IPHONE__) # if !( defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE ) # error "incorrect SDK for an iPhone build" From 7446c6433351ce8160d82e61916d5aef5b3770bb Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 21 Jul 2021 22:32:03 +0200 Subject: [PATCH 2/3] Add script to determine proc count in CI --- .github/workflows/ci.yml | 18 +----------------- build/tools/proc_count.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 17 deletions(-) create mode 100755 build/tools/proc_count.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5fd1db851a..d1e832e767 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,23 +119,7 @@ jobs: run: | echo LD_LIBRARY_PATH=`pwd`/lib >> $GITHUB_ENV - case `uname` in - Linux) - wxPROC_COUNT=`nproc` - ;; - - Darwin) - wxPROC_COUNT=`sysctl -n hw.ncpu` - ;; - - *) - echo "*** Unknown platform: `uname` ***" - wxPROC_COUNT=0 - ;; - esac - - ((wxPROC_COUNT++)) - echo wxPROC_COUNT=$wxPROC_COUNT >> $GITHUB_ENV + wxPROC_COUNT=`./build/tools/proc_count.sh` echo wxBUILD_ARGS=-j$wxPROC_COUNT >> $GITHUB_ENV # Setting this variable suppresses "Error retrieving accessibility bus address" diff --git a/build/tools/proc_count.sh b/build/tools/proc_count.sh new file mode 100755 index 0000000000..f4a5565ecd --- /dev/null +++ b/build/tools/proc_count.sh @@ -0,0 +1,18 @@ +# This script outputs the number of available processors/cores plus one. + +case `uname` in + Linux) + wxPROC_COUNT=`nproc` + ;; + + Darwin) + wxPROC_COUNT=`sysctl -n hw.ncpu` + ;; + + *) + wxPROC_COUNT=0 + ;; +esac + +((wxPROC_COUNT++)) +echo $wxPROC_COUNT From fcd9b4ba2bedc8ea244b8cf02f6fada7bb34881a Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sat, 24 Jul 2021 16:39:16 +0200 Subject: [PATCH 3/3] Add CMake builds to GitHub Actions --- .github/workflows/ci.yml | 2 + .github/workflows/ci_cmake.yml | 134 +++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 .github/workflows/ci_cmake.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1e832e767..38cb8397e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: branches: - master paths-ignore: + - '.github/workflows/ci_cmake.yml' - '.github/workflows/ci_msw_cross.yml' - 'build/tools/appveyor*.bat' - 'distrib/**' @@ -22,6 +23,7 @@ on: branches: - master paths-ignore: + - '.github/workflows/ci_cmake.yml' - '.github/workflows/ci_msw_cross.yml' - 'build/tools/appveyor*.bat' - 'distrib/**' diff --git a/.github/workflows/ci_cmake.yml b/.github/workflows/ci_cmake.yml new file mode 100644 index 0000000000..1e3ad23fd0 --- /dev/null +++ b/.github/workflows/ci_cmake.yml @@ -0,0 +1,134 @@ +# CI workflow for wxWidgets builds using CMake. +name: CMake builds + +on: + push: + branches: + - master + paths-ignore: + - '.github/workflows/ci.yml' + - '.github/workflows/ci_msw_cross.yml' + - 'build/tools/appveyor*.bat' + - 'distrib/**' + - 'docs/**' + - 'interface/**' + - 'include/msvc/**' + - 'include/wx/msw/**' + - 'locale/**' + - 'src/msw/**' + - '*.md' + - '*.yml' + - 'wxwidgets.props' + pull_request: + branches: + - master + paths-ignore: + - '.github/workflows/ci.yml' + - '.github/workflows/ci_msw_cross.yml' + - 'build/tools/appveyor*.bat' + - 'distrib/**' + - 'docs/**' + - 'interface/**' + - 'include/msvc/**' + - 'include/wx/msw/**' + - 'locale/**' + - 'src/msw/**' + - '*.md' + - '*.yml' + - 'wxwidgets.props' + +jobs: + build: + runs-on: ${{ matrix.runner }} + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu 18.04 wxGTK 3 + runner: ubuntu-18.04 + cmake_generator: Unix Makefiles + - name: macOS 10.15 wxOSX + runner: macos-10.15 + cmake_generator: Xcode + cmake_defines: -DCMAKE_CXX_STANDARD=11 + - name: macOS 10.15 wxIOS + runner: macos-10.15 + cmake_generator: Xcode + cmake_defines: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_FIND_ROOT_PATH=/usr/local -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO + cmake_samples: OFF + cmake_tests: OFF + + env: + wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Set environment variables + run: | + wxPROC_COUNT=`./build/tools/proc_count.sh` + if [ "${{ matrix.cmake_generator }}" == "Xcode" ]; then + # Xcode generates a lot of output, suppress it so only warnings and errors are visible + wxBUILD_ARGS="-jobs $wxPROC_COUNT -quiet" + else + wxBUILD_ARGS=-j$wxPROC_COUNT + fi + echo wxBUILD_ARGS=$wxBUILD_ARGS >> $GITHUB_ENV + + cmake_tests=${{ matrix.cmake_tests }} + if [ -z $cmake_tests ]; then cmake_tests=CONSOLE_ONLY; fi + echo wxCMAKE_TESTS=$cmake_tests >> $GITHUB_ENV + + cmake_samples=${{ matrix.cmake_samples }} + if [ -z $cmake_samples ]; then cmake_samples=SOME; fi + echo wxCMAKE_SAMPLES=$cmake_samples >> $GITHUB_ENV + + # Setting this variable suppresses "Error retrieving accessibility bus address" + # messages from WebKit tests that we're not interested in. + echo NO_AT_BRIDGE=1 >> $GITHUB_ENV + + - name: Before install + run: | + ./build/tools/before_install.sh + + - name: Configuring + run: | + cmake --version + mkdir build_cmake + pushd build_cmake + cmake -G "${{ matrix.cmake_generator }}" ${{ matrix.cmake_defines }} -DwxBUILD_SAMPLES=$wxCMAKE_SAMPLES -DwxBUILD_TESTS=$wxCMAKE_TESTS .. + + - name: Building + working-directory: build_cmake + run: | + cmake --build . -- $wxBUILD_ARGS + + - name: Installing + working-directory: build_cmake + run: | + sudo cmake --build . --target install + + - name: Testing + if: matrix.cmake_tests != 'OFF' + working-directory: build_cmake + run: | + . ../build/tools/httpbin.sh + + httpbin_launch + + ctest -V -C Debug --output-on-failure --interactive-debug-mode 0 . || rc=$? + if [ -n "$rc" ]; then + httpbin_show_log + exit $rc + fi + + - name: Testing installation + run: | + mkdir build_cmake_install_test + pushd build_cmake_install_test + cmake -G "${{ matrix.cmake_generator }}" ${{ matrix.cmake_defines }} ../samples/minimal + cmake --build .