Skip to content

Commit

Permalink
GHA Windows: update handling of vcpkg integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dyfer committed Mar 1, 2022
1 parent 2b0b9aa commit 7fdcbae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,11 @@ jobs:
shell: bash
run: |
export PATH=$Qt5_DIR/bin:$PATH
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
mkdir $BUILD_PATH && cd $BUILD_PATH
EXTRA_CMAKE_FLAGS=
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then EXTRA_CMAKE_FLAGS="-D CMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake $EXTRA_CMAKE_FLAGS"; fi
cmake -G "${{ matrix.cmake-generator }}" -A "${{ matrix.cmake-arch }}" -D CMAKE_PREFIX_PATH=$Qt5_DIR -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=${{ matrix.use-qtwebengine }} -D SC_ABLETON_LINK=${{ matrix.ableton-link }} -D CMAKE_BUILD_TYPE=Release $EXTRA_CMAKE_FLAGS .. # build type is specified here for MinGW build
cmake -G "${{ matrix.cmake-generator }}" -A "${{ matrix.cmake-arch }}" -D CMAKE_PREFIX_PATH="$Qt5_DIR" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=${{ matrix.use-qtwebengine }} -D SC_ABLETON_LINK=${{ matrix.ableton-link }} -D CMAKE_BUILD_TYPE=Release .. # build type is specified here for MinGW build
- name: build
shell: bash
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
cmake_minimum_required(VERSION 3.12)

# pick up vcpkg installation, if VCPKG_ROOT is set
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE AND NOT "$ENV{VCPKG_ROOT}" STREQUAL "")
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
message(STATUS "Using CMAKE_TOOLCHAIN_FILE at ${CMAKE_TOOLCHAIN_FILE}")
endif()

include(SCVersion.txt)
# CMake versions can only consist of digits and periods, so don't use _TWEAK
project(SuperCollider VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH})
Expand Down
9 changes: 5 additions & 4 deletions README_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1209,15 +1209,16 @@ if you require an advanced configuration, and are interested in this approach.

### Readline support

Previously Windows builds of SuperCollider did not support command line mode for sclang due to unavailability of the `readline` library. Currently it is possible to install `readline` using [vcpkg](https://github.com/microsoft/vcpkg). Here are steps to build SC with `readline` library (the following commands assume using MSVC):
Previously Windows builds of SuperCollider did not support command line mode for sclang due to unavailability of the `readline` library. Currently it is possible to install `readline` using [vcpkg](https://github.com/microsoft/vcpkg). Follow these steps to build SC with the `readline` library (note that the following commands assume using MSVC):
- install `vcpkg`, if not installed already
- install the library using `vcpkg`:
`vcpkg install readline --triplet=x64-windows`
- include `vcpkg` path in `CMAKE_PREFIX_PATH` (in addition to the Qt path defined already):
`SET CMAKE_PREFIX_PATH=<qt_path>;<vcpkg_root>\installed\x64-windows`
- set `VCPKG_ROOT` environment variable to point to the root `vcpkg` directory:
`SET VCPKG_ROOT=c:\path\to\vcpkg`
- readline should be picked up by CMake during the configuration stage

Note:
- For 32-bit builds use `x86-windows` instead of `x64-windows` triplet, both when installing `readline` as well as specifying `CMAKE_PREFIX_PATH`
- For 32-bit builds use `x86-windows` instead of `x64-windows` triplet when installing `readline`
- At the time of writing this, `readline` would not build using a triplet for MinGW

Known issues
Expand Down

0 comments on commit 7fdcbae

Please sign in to comment.