From b48ea5b361be29d82ab2cc607b84cfde82d14604 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 23 Mar 2022 02:29:21 +0800 Subject: [PATCH] Update Alpine build --- .github/workflows/alpine-build.yml | 6 +++--- CMakeLists.txt | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/alpine-build.yml b/.github/workflows/alpine-build.yml index 03b5a915..6a2adf7c 100644 --- a/.github/workflows/alpine-build.yml +++ b/.github/workflows/alpine-build.yml @@ -31,9 +31,9 @@ jobs: libxml2-utils libpng-dev freetype-dev fontconfig-dev git valgrind - name: Configure CMake - # env: - # CC: clang - # CXX: clang++ + env: + CC: gcc + CXX: g++ run: | cmake -B ${{github.workspace}} \ -DVCPKG_TARGET_TRIPLET=x86_64-alpine-linux-musl diff --git a/CMakeLists.txt b/CMakeLists.txt index e0295260..70e8dd58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,15 +138,15 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_definitions(-DDARWIN) endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") -# Locate fontconfig -include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindFontconfig.cmake) - # Find/build external dependencies if it is Microsoft Visual Studio build if(MSVC) find_package(Iconv REQUIRED) set(EXTERNAL_ICONV ${Iconv_LIBRARY}) endif(MSVC) +# Locate fontconfig, somehow the find_package call can't find it? +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindFontconfig.cmake) + if(MSVC OR ALPINE) set(ARGP_NAME argp${EXTERNAL_LIB_DIR_SUFFIX}) ExternalProject_Add(${ARGP_NAME} @@ -157,6 +157,7 @@ if(MSVC OR ALPINE) PATCH_COMMAND cd ${DEPS}/src/${ARGP_NAME} && git restore CMakeLists.txt && git apply ${PATCHES}/argp/CMakeLists.txt.patch ) set(EXTERNAL_ARGP "argp-standalone") + add_compile_options(-fPIC) endif(MSVC OR ALPINE) # headers & library directories