Skip to content

Commit

Permalink
Separate Windows workflow, remove public CMake option
Browse files Browse the repository at this point in the history
  • Loading branch information
kboyarinov committed Feb 6, 2025
1 parent 0c4225b commit 00292b9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ jobs:
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_CPF=${{ matrix.preview }} -DTBB_TEST=OFF -DTBB_EXAMPLES=ON ..
cmake --build . -v --target light_test_examples
doc-examples-testing:
linux-doc-examples-testing:
name: doc_examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 10
Expand All @@ -376,11 +376,29 @@ jobs:
matrix:
include:
- os: ubuntu-latest
generator: Unix Makefiles
c_compiler: gcc
cxx_compiler: g++
std: 20
build_type: relwithdebinfo
steps:
- uses: actions/checkout@v4
- name: Test doc examples
run: |
mkdir build && cd build
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type}} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
-DTBB_TEST=OFF -DTBB_DOC_EXAMPLES=ON ..
cmake --build . -v --parallel --target build-doc-examples
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure -L doc-examples
windows-doc-examples-testing:
name: doc_examples_${{ matrix.os }}_${{ matrix.cxx_compiler }}_cxx${{ matrix.std }}_${{ matrix.build_type }}
runs-on: ['${{ matrix.os }}']
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
generator: "Visual Studio 17 2022"
c_compiler: cl
Expand All @@ -391,9 +409,10 @@ jobs:
- uses: actions/checkout@v4
- name: Test doc examples
run: |
mkdir build && cd build
cmake -G "${{ matrix.generator }}" -DCMAKE_CXX_STANDARD=${{ matrix.std }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type}} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
mkdir build
cd build
cmake -G "${{ matrix.generator }}" -A x64 -DCMAKE_CXX_STANDARD=${{ matrix.std }} `
-DCMAKE_BUILD_TYPE=${{ matrix.build_type}} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} `
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DTBB_TEST=ON -D_TBB_DOC_EXAMPLES=ON ..
cmake --build . -v --parallel --target build-doc-examples
ctest -C ${{ matrix.build_type }} --timeout ${env:TEST_TIMEOUT} --output-on-failure -L doc-examples
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ endif()

option(TBB_TEST "Enable testing" ON)
option(TBB_EXAMPLES "Enable examples" OFF)
option(_TBB_DOC_EXAMPLES "Enable documentation examples" OFF)
option(TBB_STRICT "Treat compiler warnings as errors" ON)
option(TBB_WINDOWS_DRIVER "Build as Universal Windows Driver (UWD)" OFF)
option(TBB_NO_APPCONTAINER "Apply /APPCONTAINER:NO (for testing binaries for Windows Store)" OFF)
Expand Down Expand Up @@ -331,12 +330,13 @@ if (TBB_EXAMPLES)
add_subdirectory(examples)
endif()

set(TBB_DOC_EXAMPLES_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/main/examples_testing")

if (_TBB_DOC_EXAMPLES)
if (TBB_DOC_EXAMPLES)
set(TBB_DOC_EXAMPLES_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/main/examples_testing")
if (NOT EXISTS ${TBB_DOC_EXAMPLES_DIRECTORY})
message(FATAL_ERROR "Documentation examples are not found while testing was enabled")
else()
enable_testing()
add_subdirectory(${TBB_DOC_EXAMPLES_DIRECTORY})
endif()
endif()
Expand Down

0 comments on commit 00292b9

Please sign in to comment.