Commit 67cc662 Aleksandar Glisic
committed
1 parent e4e7624 commit 67cc662 Copy full SHA for 67cc662
File tree 2 files changed +21
-7
lines changed
2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -116,10 +116,14 @@ set(SNITCH_SOURCES_INDIVIDUAL
116
116
${PROJECT_SOURCE_DIR} /src/snitch_test_data.cpp
117
117
${PROJECT_SOURCE_DIR} /src/snitch_time.cpp)
118
118
119
- if (SNITCH_UNITY_BUILD)
120
- set (SNITCH_SOURCES ${PROJECT_SOURCE_DIR} /src/snitch.cpp)
119
+ if (SNITCH_ENABLE)
120
+ if (SNITCH_UNITY_BUILD)
121
+ set (SNITCH_SOURCES ${PROJECT_SOURCE_DIR} /src/snitch.cpp)
122
+ else ()
123
+ set (SNITCH_SOURCES ${SNITCH_SOURCES_INDIVIDUAL} )
124
+ endif ()
121
125
else ()
122
- set (SNITCH_SOURCES ${SNITCH_SOURCES_INDIVIDUAL} )
126
+ set (SNITCH_SOURCES ${PROJECT_SOURCE_DIR} /src/snitch_main.cpp )
123
127
endif ()
124
128
125
129
function (configure_snitch_exports TARGET )
@@ -212,7 +216,7 @@ install(FILES
212
216
DESTINATION ${CMAKE_INSTALL_PREFIX} /lib/cmake/snitch COMPONENT Development)
213
217
214
218
# Setup tests
215
- if (SNITCH_DO_TEST)
219
+ if (SNITCH_DO_TEST AND SNITCH_ENABLE )
216
220
enable_testing ()
217
221
218
222
# We need to use a different snitch configuration for tests, so we can't reuse
Original file line number Diff line number Diff line change 1
1
#include " snitch/snitch_cli.hpp"
2
2
#include " snitch/snitch_registry.hpp"
3
3
4
- #if SNITCH_DEFINE_MAIN
5
- SNITCH_EXPORT int main (int argc, char * argv[]) {
4
+ namespace snitch {
5
+ SNITCH_EXPORT int main ([[maybe_unused]] int argc, [[maybe_unused]] char * argv[]) {
6
+ #if SNITCH_ENABLE
6
7
std::optional<snitch::cli::input> args = snitch::cli::parse_arguments (argc, argv);
7
8
if (!args) {
8
9
return 1 ;
@@ -11,5 +12,14 @@ SNITCH_EXPORT int main(int argc, char* argv[]) {
11
12
snitch::tests.configure (*args);
12
13
13
14
return snitch::tests.run_tests (*args) ? 0 : 1 ;
14
- }
15
+ #else
16
+ return 0 ;
15
17
#endif
18
+ }
19
+ }
20
+
21
+ #if SNITCH_DEFINE_MAIN
22
+ SNITCH_EXPORT int main (int argc, char * argv[]) {
23
+ return snitch::main (argc, argv);
24
+ }
25
+ #endif
You can’t perform that action at this time.
0 commit comments