Skip to content

Commit 40af932

Browse files
committed
Remove cmake_expand_generator_expressions in projects with less than 3 dependencies.
1 parent c971a53 commit 40af932

File tree

13 files changed

+85
-86
lines changed

13 files changed

+85
-86
lines changed

source/tests/metacall_cast_test/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Check if this loader is enabled
2+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY)
3+
return()
4+
endif()
5+
16
#
27
# Executable name and options
38
#
@@ -122,14 +127,10 @@ add_test(NAME ${target}
122127
# Define dependencies
123128
#
124129

125-
include(GeneratorExpressions)
126-
127-
cmake_expand_generator_expressions(DEPENDENCIES
128-
$<$<BOOL:${OPTION_BUILD_LOADERS_PY}>:py_loader>
130+
add_dependencies(${target}
131+
py_loader
129132
)
130133

131-
add_dependencies(${target} ${DEPENDENCIES})
132-
133134
#
134135
# Define test properties
135136
#

source/tests/metacall_clear_test/CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Setup distributable environment
33
#
44

5-
# Check if distributable libs are enabled
6-
if(NOT OPTION_BUILD_DIST_LIBS)
5+
# Check if this loader is enabled
6+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY)
77
return()
88
endif()
99

@@ -142,14 +142,10 @@ add_test(NAME ${target}
142142
# Define dependencies
143143
#
144144

145-
include(GeneratorExpressions)
146-
147-
cmake_expand_generator_expressions(DEPENDENCIES
148-
$<$<BOOL:${OPTION_BUILD_LOADERS_PY}>:py_loader>
145+
add_dependencies(${target}
146+
py_loader
149147
)
150148

151-
add_dependencies(${target} ${DEPENDENCIES})
152-
153149
#
154150
# Define test properties
155151
#

source/tests/metacall_duplicated_handle_test/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
# Check if this loader is enabled
3+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY)
4+
return()
5+
endif()
6+
17
#
28
# Executable name and options
39
#
@@ -122,14 +128,10 @@ add_test(NAME ${target}
122128
# Define dependencies
123129
#
124130

125-
include(GeneratorExpressions)
126-
127-
cmake_expand_generator_expressions(DEPENDENCIES
128-
$<$<BOOL:${OPTION_BUILD_LOADERS_PY}>:py_loader>
131+
add_dependencies(${target}
132+
py_loader
129133
)
130134

131-
add_dependencies(${target} ${DEPENDENCIES})
132-
133135
#
134136
# Define test properties
135137
#

source/tests/metacall_duplicated_symbols_test/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Check if this loader is enabled
2+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_RB)
3+
return()
4+
endif()
5+
16
#
27
# Executable name and options
38
#
@@ -122,14 +127,10 @@ add_test(NAME ${target}
122127
# Define dependencies
123128
#
124129

125-
include(GeneratorExpressions)
126-
127-
cmake_expand_generator_expressions(DEPENDENCIES
128-
$<$<BOOL:${OPTION_BUILD_LOADERS_RB}>:rb_loader>
130+
add_dependencies(${target}
131+
rb_loader
129132
)
130133

131-
add_dependencies(${target} ${DEPENDENCIES})
132-
133134
#
134135
# Define test properties
135136
#

source/tests/metacall_handle_export_test/CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Setup distributable environment
33
#
44

5-
# Check if distributable libs are enabled
6-
if(NOT OPTION_BUILD_DIST_LIBS)
5+
# Check if this loader is enabled
6+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_NODE)
77
return()
88
endif()
99

@@ -142,15 +142,11 @@ add_test(NAME ${target}
142142
# Define dependencies
143143
#
144144

145-
include(GeneratorExpressions)
146-
147-
cmake_expand_generator_expressions(DEPENDENCIES
148-
$<$<BOOL:${OPTION_BUILD_LOADERS_NODE}>:node_loader>
149-
$<$<BOOL:${OPTION_BUILD_LOADERS_PY}>:py_loader>
145+
add_dependencies(${target}
146+
node_loader
147+
py_loader
150148
)
151149

152-
add_dependencies(${target} ${DEPENDENCIES})
153-
154150
#
155151
# Define test properties
156152
#

source/tests/metacall_init_fini_test/CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Setup distributable environment
33
#
44

5-
# Check if distributable libs are enabled
6-
if(NOT OPTION_BUILD_DIST_LIBS)
5+
# Check if this loader is enabled
6+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY)
77
return()
88
endif()
99

@@ -142,14 +142,10 @@ add_test(NAME ${target}
142142
# Define dependencies
143143
#
144144

145-
include(GeneratorExpressions)
146-
147-
cmake_expand_generator_expressions(DEPENDENCIES
148-
$<$<BOOL:${OPTION_BUILD_LOADERS_PY}>:py_loader>
145+
add_dependencies(${target}
146+
py_loader
149147
)
150148

151-
add_dependencies(${target} ${DEPENDENCIES})
152-
153149
#
154150
# Define test properties
155151
#

source/tests/metacall_initialize_ex_test/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Check if this loader is enabled
2+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_MOCK)
3+
return()
4+
endif()
5+
16
#
27
# Executable name and options
38
#
@@ -122,14 +127,10 @@ add_test(NAME ${target}
122127
# Define dependencies
123128
#
124129

125-
include(GeneratorExpressions)
126-
127-
cmake_expand_generator_expressions(DEPENDENCIES
128-
$<$<BOOL:${OPTION_BUILD_LOADERS_MOCK}>:mock_loader>
130+
add_dependencies(${target}
131+
mock_loader
129132
)
130133

131-
add_dependencies(${target} ${DEPENDENCIES})
132-
133134
#
134135
# Define test properties
135136
#

source/tests/metacall_initialize_test/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Check if this loader is enabled
2+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_MOCK)
3+
return()
4+
endif()
5+
16
#
27
# Executable name and options
38
#
@@ -122,14 +127,10 @@ add_test(NAME ${target}
122127
# Define dependencies
123128
#
124129

125-
include(GeneratorExpressions)
126-
127-
cmake_expand_generator_expressions(DEPENDENCIES
128-
$<$<BOOL:${OPTION_BUILD_LOADERS_MOCK}>:mock_loader>
130+
add_dependencies(${target}
131+
mock_loader
129132
)
130133

131-
add_dependencies(${target} ${DEPENDENCIES})
132-
133134
#
134135
# Define test properties
135136
#

source/tests/metacall_load_configuration_relative_test/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Check if this loader is enabled
2+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_NODE)
3+
return()
4+
endif()
5+
16
#
27
# Executable name and options
38
#
@@ -123,14 +128,10 @@ add_test(NAME ${target}
123128
# Define dependencies
124129
#
125130

126-
include(GeneratorExpressions)
127-
128-
cmake_expand_generator_expressions(DEPENDENCIES
129-
$<$<BOOL:${OPTION_BUILD_LOADERS_NODE}>:node_loader>
131+
add_dependencies(${target}
132+
node_loader
130133
)
131134

132-
add_dependencies(${target} ${DEPENDENCIES})
133-
134135
#
135136
# Configure test data
136137
#

source/tests/metacall_map_await_test/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Check if this loader is enabled
2+
if(NOT OPTION_BUILD_DIST_LIBS OR NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_NODE)
3+
return()
4+
endif()
5+
16
#
27
# Executable name and options
38
#
@@ -122,14 +127,10 @@ add_test(NAME ${target}
122127
# Define dependencies
123128
#
124129

125-
include(GeneratorExpressions)
126-
127-
cmake_expand_generator_expressions(DEPENDENCIES
128-
$<$<BOOL:${OPTION_BUILD_LOADERS_NODE}>:node_loader>
130+
add_dependencies(${target}
131+
node_loader
129132
)
130133

131-
add_dependencies(${target} ${DEPENDENCIES})
132-
133134
#
134135
# Define test properties
135136
#

0 commit comments

Comments
 (0)