Skip to content

Commit

Permalink
[INFRA] Update TDL
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Feb 9, 2024
1 parent d48c51f commit 2e77d09
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ defaults:

jobs:
build:
name: "External project"
name: "External project ${{ contains(matrix.SHARG_NO_TDL, 'OFF') && 'with TDL' || 'without TDL' }}"
runs-on: ubuntu-22.04
timeout-minutes: 120
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
strategy:
fail-fast: false
matrix:
SHARG_NO_TDL: [ON, OFF]

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -48,13 +53,18 @@ jobs:
uses: seqan/actions/setup-toolchain@main
with:
compiler: gcc-13
use_actions_cache: false

- name: Install dependencies
if: matrix.SHARG_NO_TDL == 'OFF'
run: |
FILENAME="libyaml-cpp-dev_0.8.0+dfsg-6_amd64.deb"
wget http://http.us.debian.org/debian/pool/main/y/yaml-cpp/${FILENAME} && sudo dpkg -i ${FILENAME}
- name: Configure tests
run: |
mkdir sharg-build
cd sharg-build
cmake ../sharg-parser/test/external_project -DCMAKE_BUILD_TYPE=Debug
cmake ../sharg-parser/test/external_project -DCMAKE_BUILD_TYPE=Debug -DSHARG_NO_TDL=${{ matrix.SHARG_NO_TDL }}
make -j2 sharg_test_prerequisite
- name: Build tests
Expand Down
14 changes: 13 additions & 1 deletion build_system/sharg-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,19 @@ endif ()
set (SHARG_USE_TDL FALSE)

if (NOT SHARG_NO_TDL)
find_package (TDL QUIET HINTS ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib ${SHARG_HINT_TDL})
find_package (TDL QUIET HINTS ${SHARG_HINT_TDL})

if (NOT TDL_FOUND)
if (EXISTS ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib)
include (FetchContent)
FetchContent_Declare (tdl SOURCE_DIR ${SHARG_SUBMODULES_DIR}/submodules/tool_description_lib)
set (SHARG_LOG_LEVEL ${CMAKE_MESSAGE_LOG_LEVEL})
set (CMAKE_MESSAGE_LOG_LEVEL "ERROR")
FetchContent_MakeAvailable (tdl)
set (CMAKE_MESSAGE_LOG_LEVEL ${SHARG_LOG_LEVEL})
set (TDL_FOUND TRUE)
endif ()
endif ()

if (TDL_FOUND)
sharg_config_print ("Optional dependency: TDL found.")
Expand Down
1 change: 0 additions & 1 deletion test/snippet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ endmacro ()
macro (sharg_snippets test_name_prefix snippet_base_path_)
get_filename_component (snippet_base_path "${snippet_base_path_}" ABSOLUTE BASE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/../..")
message (STATUS "${snippet_base_path}")
sharg_test_files (snippet_files "${snippet_base_path}" "*.cpp")
foreach (snippet ${snippet_files})
sharg_snippet ("${test_name_prefix}" "${snippet}" "${snippet_base_path}")
Expand Down

0 comments on commit 2e77d09

Please sign in to comment.