Skip to content

Commit

Permalink
fix to build with boxed-cpp (#1301)
Browse files Browse the repository at this point in the history
* fix to build with boxed-cpp

* modify commit id in scripts/install-deps.ps1 file

* update action to use gcc-10

* Update .github/workflows/build.yml

Co-authored-by: Christian Parpart <christian@parpart.family>

---------

Co-authored-by: Yaraslau Tamashevich <yaraslau.tamashevich@gmail.com>
Co-authored-by: Christian Parpart <christian@parpart.family>
  • Loading branch information
3 people authored Oct 24, 2023
1 parent e22a69c commit 9b8c5a6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ jobs:
if [[ ${{ matrix.os_version }} = "20.04" ]]; then
echo "QTVER=5" >> "$GITHUB_OUTPUT"
fi
- name: "Install gcc-10 on 20.04"
if: matrix.os_version == '20.04'
run: sudo apt -y install gcc-10
- name: "install dependencies"
run: sudo env QTVER="${{ steps.set_qtver.outputs.QTVER }}" ./scripts/install-deps.sh
- name: "Post-fix embedded dependency permissions."
Expand All @@ -669,7 +672,7 @@ jobs:
# TODO: turn on -Werror again, that requires some code changes.
CMAKE_CXX_STANDARD=20
if [[ "${{ matrix.os_version }}" = "20.04" ]]; then
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_QT_VERSION=5"
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_QT_VERSION=5 -DCMAKE_CXX_COMPILER=g++-10"
else
# use Qt6 for 22.04
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DCONTOUR_QT_VERSION=6"
Expand Down
11 changes: 8 additions & 3 deletions cmake/ContourThirdParties.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,13 @@ else()
set(THIRDPARTY_BUILTIN_termbench "(bench-headless disabled)")
endif()

ContourThirdParties_Embed_boxed_cpp()
set(THIRDPARTY_BUILDIN_boxed_cpp "embedded")
find_package(boxed-cpp)
if(boxed-cpp_FOUND)
set(THIRDPARTY_BUILTIN_boxed_cpp "system package")
else()
ContourThirdParties_Embed_boxed_cpp()
set(THIRDPARTY_BUILTIN_boxed_cpp "embedded")
endif()

macro(ContourThirdPartiesSummary2)
message(STATUS "==============================================================================")
Expand All @@ -143,6 +148,6 @@ macro(ContourThirdPartiesSummary2)
message(STATUS "termbench-pro ${THIRDPARTY_BUILTIN_termbench}")
message(STATUS "libunicode ${THIRDPARTY_BUILTIN_unicode_core} (${LIBUNICODE_LIBS})")
message(STATUS "yaml-cpp ${THIRDPARTY_BUILTIN_yaml_cpp}")
message(STATUS "boxed-cpp ${THIRDPARTY_BUILDIN_boxed_cpp}")
message(STATUS "boxed-cpp ${THIRDPARTY_BUILTIN_boxed_cpp}")
message(STATUS "------------------------------------------------------------------------------")
endmacro()
6 changes: 3 additions & 3 deletions scripts/install-deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ $ThirdParties =
Macro = "termbench_pro"
}
[ThirdParty]@{
Folder = "boxed-cpp-daa702e22e71f3da3eef838e4946b6c3df1f16b1";
Archive = "boxed-cpp-daa702e22e71f3da3eef838e4946b6c3df1f16b1.zip";
URI = "https://github.com/contour-terminal/boxed-cpp/archive/daa702e22e71f3da3eef838e4946b6c3df1f16b1.zip";
Folder = "boxed-cpp-783cb74e95cbe06a52b468a73c14467e8f082cd1";
Archive = "boxed-cpp-783cb74e95cbe06a52b468a73c14467e8f082cd1.zip";
URI = "https://github.com/contour-terminal/boxed-cpp/archive/783cb74e95cbe06a52b468a73c14467e8f082cd1.zip";
Macro = "boxed_cpp"
}
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fetch_and_unpack_termbenchpro()

fetch_and_unpack_boxed()
{
local boxed_cpp_git_sha="daa702e22e71f3da3eef838e4946b6c3df1f16b1"
local boxed_cpp_git_sha="783cb74e95cbe06a52b468a73c14467e8f082cd1"
fetch_and_unpack \
boxed-cpp-$boxed_cpp_git_sha \
boxed-cpp-$boxed_cpp_git_sha.tar.gz \
Expand Down
2 changes: 1 addition & 1 deletion src/crispy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if(MSVC)
target_compile_definitions(crispy-core PUBLIC NOMINMAX)
endif()

set(CRISPY_CORE_LIBS range-v3::range-v3 fmt::fmt-header-only unicode Microsoft.GSL::GSL boxed-cpp)
set(CRISPY_CORE_LIBS range-v3::range-v3 fmt::fmt-header-only unicode Microsoft.GSL::GSL boxed-cpp::boxed-cpp)

if(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
target_compile_options(crispy-core PUBLIC -maes)
Expand Down
2 changes: 1 addition & 1 deletion src/text_shaper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ endif()
add_library(text_shaper STATIC ${text_shaper_SRC})
set_target_properties(text_shaper PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")

set(TEXT_SHAPER_LIBS unicode boxed-cpp)
set(TEXT_SHAPER_LIBS unicode boxed-cpp::boxed-cpp)
list(APPEND TEXT_SHAPER_LIBS fmt::fmt-header-only)
list(APPEND TEXT_SHAPER_LIBS range-v3::range-v3)
list(APPEND TEXT_SHAPER_LIBS Microsoft.GSL::GSL)
Expand Down

0 comments on commit 9b8c5a6

Please sign in to comment.