Skip to content

Commit 5915383

Browse files
committed
Fix CMake to enable a UI-only build with unit tests
1 parent b54baa6 commit 5915383

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

cmake/FindClangFormat.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@
3232
function(target_clangformat TARGET)
3333

3434
set(options "")
35-
set(single_value_args CONDITION)
36-
set(multi_value_args "")
35+
set(single_value_args "")
36+
set(multi_value_args CONDITION)
3737
cmake_parse_arguments( ARGS "${options}" "${single_value_args}" "${multi_value_args}" ${ARGN} )
3838

3939
# Skip setup if condition supplied and FALSE
40-
if (NOT ${ARGS_CONDITION})
41-
return()
40+
if (DEFINED ARGS_CONDITION)
41+
if (${${ARGS_CONDITION}})
42+
# Do nothing, just continue
43+
else()
44+
return()
45+
endif()
4246
endif()
4347

4448
# Skip setup if clang-format is not available...

libs/client/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ ecbuild_add_test(
143143
ecflow_server # the server is launched to support tests
144144
TEST_DEPENDS
145145
u_base
146+
CONDITION
147+
ENABLE_SERVER # AND ENABLE_TESTS
146148
)
147149
target_clangformat(s_client
148-
CONDITION ENABLE_TESTS
150+
CONDITION ENABLE_SERVER AND ENABLE_TESTS
149151
)
150152

151153
if (ENABLE_ALL_TESTS AND ENABLE_SERVER)

0 commit comments

Comments
 (0)