Merge pull request #690 from jpcima/mingw-dwrite3

Workaround for MinGW CI to build custom font support
This commit is contained in:
JP Cimalando 2021-03-10 12:20:18 +01:00 committed by GitHub
commit 9d3be1ac94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12316 additions and 6 deletions

View file

@ -72,7 +72,8 @@ jobs:
-DSFIZZ_SHARED=OFF \
-DSFIZZ_STATIC_DEPENDENCIES=OFF \
-DSFIZZ_LV2=ON \
-DCMAKE_CXX_STANDARD=17
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
@ -118,7 +119,8 @@ jobs:
run: |
mod-plugin-builder /usr/local/bin/cmake "$GITHUB_WORKSPACE" \
-DSFIZZ_SYSTEM_PROCESSOR=armv7-a \
-DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_VST=OFF -DSFIZZ_LV2_UI=OFF
-DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_VST=OFF -DSFIZZ_LV2_UI=OFF \
-DBUILD_SHARED_LIBS=OFF
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
@ -161,6 +163,11 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Fix MinGW headers
shell: bash
run: |
cp -vf "$GITHUB_WORKSPACE"/scripts/mingw_dwrite_3.h \
/usr/i686-w64-mingw32/include/dwrite_3.h
- name: Fix VST sources
shell: bash
# need to convert some includes to lower case (as of VST 3.7.1)
@ -182,7 +189,8 @@ jobs:
-DSFIZZ_JACK=OFF \
-DSFIZZ_VST=ON \
-DSFIZZ_STATIC_DEPENDENCIES=ON \
-DCMAKE_CXX_STANDARD=17
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
@ -225,6 +233,11 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Fix MinGW headers
shell: bash
run: |
cp -vf "$GITHUB_WORKSPACE"/scripts/mingw_dwrite_3.h \
/usr/x86_64-w64-mingw32/include/dwrite_3.h
- name: Fix VST sources
shell: bash
# need to convert some includes to lower case (as of VST 3.7.1)
@ -246,7 +259,8 @@ jobs:
-DSFIZZ_JACK=OFF \
-DSFIZZ_VST=ON \
-DSFIZZ_STATIC_DEPENDENCIES=ON \
-DCMAKE_CXX_STANDARD=17
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build

View file

@ -213,9 +213,23 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
endif()
# Windows 10 RS2 DDI for custom fonts
target_compile_definitions(sfizz_vstgui PRIVATE "NTDDI_VERSION=0x0A000003")
# disable custom fonts while dwrite3 API is unavailable in MinGW
# disable custom fonts if dwrite3 API is unavailable in MinGW
if(MINGW)
target_compile_definitions(sfizz_vstgui PRIVATE "VSTGUI_WIN32_CUSTOMFONT_SUPPORT=0")
check_cxx_source_compiles("
#include <windows.h>
#include <dwrite_3.h>
HRESULT FeatureCheck(IDWriteFontSet* self, const WCHAR* name, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STRETCH stretch, DWRITE_FONT_STYLE style, IDWriteFontSet** fontset)
{
return self->GetMatchingFonts(name, weight, stretch, style, fontset);
}
int main()
{
return 0;
}" SFIZZ_MINGW_SUPPORTS_DWRITE3)
if(NOT SFIZZ_MINGW_SUPPORTS_DWRITE3)
message(WARNING "This version of MinGW does not support DirectWrite 3. Custom font support is disabled.")
target_compile_definitions(sfizz_vstgui PRIVATE "VSTGUI_WIN32_CUSTOMFONT_SUPPORT=0")
endif()
endif()
endif()

View file

@ -11,5 +11,6 @@ cmake .. -G"Visual Studio 16 2019" -A"%RELEASE_ARCH%"^
-DSFIZZ_LV2=ON^
-DSFIZZ_VST=ON^
-DCMAKE_BUILD_TYPE=Release^
-DBUILD_SHARED_LIBS=OFF^
-DVCPKG_TARGET_TRIPLET=%VCPKG_TRIPLET%^
-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake

View file

@ -10,6 +10,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \
-DSFIZZ_SHARED=OFF \
-DSFIZZ_TESTS=ON \
-DCMAKE_CXX_STANDARD=14 \
-DBUILD_SHARED_LIBS=OFF \
-DLV2PLUGIN_INSTALL_DIR=/ \
-DVSTPLUGIN_INSTALL_DIR=/ \
-DAUPLUGIN_INSTALL_DIR=/ \

12280
scripts/mingw_dwrite_3.h Normal file

File diff suppressed because it is too large Load diff