Skip to content

Commit

Permalink
build: add option to compile examples
Browse files Browse the repository at this point in the history
It is enabled by default, but we disable it of course for release builds, but
also for coverage builds to speed up the compilation in ci.

As a replacement we add another matrix job with the gcc preset to ensure that
all possible gcc compositor warnings as errors are also catched in the example
code.
  • Loading branch information
romangg committed Mar 9, 2024
1 parent fc9bef8 commit e49ffc5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
builds:
strategy:
matrix:
preset: [clang, release]
preset: [clang, gcc, release]
uses: ./.github/workflows/build.yml
with:
image: registry.gitlab.com/kwinft/ci-images/archlinux/kwinft-base-master
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ ecm_find_qmlmodule(org.kde.kquickcontrolsaddons 2.0)
ecm_find_qmlmodule(org.kde.plasma.core 2.0)
ecm_find_qmlmodule(org.kde.plasma.components 2.0)

option(BUILD_EXAMPLES "Enable building examples." ON)
option(COMO_BUILD_DECORATIONS "Enable building of decorations." ON)
option(COMO_BUILD_KCMS "Enable building of configuration modules." ON)
option(COMO_BUILD_TABBOX "Enable building of Tabbox functionality" ON)
Expand Down Expand Up @@ -342,7 +343,9 @@ if (BUILD_TESTING)
add_subdirectory(tests)
endif()

add_subdirectory(examples)
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

if (KF6DocTools_FOUND)
add_subdirectory(docs)
Expand Down
16 changes: 14 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@
"description": "Clang Build with tests and coverage reporting enabled",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "$env{DEBUG_CXX_FLAGS_CLANG} --coverage",
"CMAKE_EXE_LINKER_FLAGS": "--coverage"
"CMAKE_EXE_LINKER_FLAGS": "--coverage",
"BUILD_EXAMPLES": {
"type": "BOOL",
"value": "OFF"
}
}
},
{
Expand All @@ -91,7 +95,11 @@
"CMAKE_CXX_FLAGS": "$env{DEBUG_CXX_FLAGS_GCC} --coverage -fprofile-abs-path",
"CMAKE_SHARED_LINKER_FLAGS": "$env{DEBUG_SHARED_LINKER_FLAGS} $env{NOUNDEF_LINKER_FLAGS} --coverage -fprofile-abs-path",
"CMAKE_MODULE_LINKER_FLAGS": "$env{DEBUG_MODULE_LINKER_FLAGS} $env{NOUNDEF_LINKER_FLAGS} --coverage -fprofile-abs-path",
"CMAKE_EXE_LINKER_FLAGS": "--coverage -fprofile-abs-path"
"CMAKE_EXE_LINKER_FLAGS": "--coverage -fprofile-abs-path",
"BUILD_EXAMPLES": {
"type": "BOOL",
"value": "OFF"
}
}
},
{
Expand All @@ -106,6 +114,10 @@
"BUILD_TESTING": {
"type": "BOOL",
"value": "OFF"
},
"BUILD_EXAMPLES": {
"type": "BOOL",
"value": "OFF"
}
}
}
Expand Down

0 comments on commit e49ffc5

Please sign in to comment.