|
3 | 3 |
|
4 | 4 | include(GoogleTest) |
5 | 5 |
|
6 | | -# Header only singletons are not available in windows yet. |
7 | | - |
8 | | -if(NOT WIN32) |
9 | | - |
10 | | - add_library(component_a STATIC component_a.cc) |
11 | | - target_link_libraries(component_a opentelemetry_api) |
12 | | - |
13 | | - add_library(component_b STATIC component_b.cc) |
14 | | - target_link_libraries(component_b opentelemetry_api) |
15 | | - |
16 | | - add_library(component_c SHARED component_c.cc) |
17 | | - set_target_properties(component_c PROPERTIES CXX_VISIBILITY_PRESET default) |
18 | | - target_link_libraries(component_c opentelemetry_api) |
19 | | - |
20 | | - add_library(component_d SHARED component_d.cc) |
21 | | - set_target_properties(component_d PROPERTIES CXX_VISIBILITY_PRESET hidden) |
22 | | - target_link_libraries(component_d opentelemetry_api) |
23 | | - |
24 | | - add_library(component_e SHARED component_e.cc) |
25 | | - set_target_properties(component_e PROPERTIES CXX_VISIBILITY_PRESET default) |
26 | | - target_link_libraries(component_e opentelemetry_api) |
27 | | - |
28 | | - add_library(component_f SHARED component_f.cc) |
29 | | - set_target_properties(component_f PROPERTIES CXX_VISIBILITY_PRESET hidden) |
30 | | - target_link_libraries(component_f opentelemetry_api) |
31 | | - |
32 | | - add_library(component_g SHARED component_g.cc) |
33 | | - set_target_properties(component_g PROPERTIES CXX_VISIBILITY_PRESET default) |
34 | | - target_link_libraries(component_g opentelemetry_api) |
35 | | - |
36 | | - add_library(component_h SHARED component_h.cc) |
37 | | - set_target_properties(component_h PROPERTIES CXX_VISIBILITY_PRESET hidden) |
38 | | - target_link_libraries(component_h opentelemetry_api) |
39 | | - |
40 | | - add_executable(singleton_test singleton_test.cc) |
41 | | - |
42 | | - # Not linking with component_g and component_h on purpose |
43 | | - target_link_libraries( |
44 | | - singleton_test |
45 | | - component_a |
46 | | - component_b |
47 | | - component_c |
48 | | - component_d |
49 | | - component_e |
50 | | - component_f |
51 | | - ${GTEST_BOTH_LIBRARIES} |
52 | | - ${CMAKE_THREAD_LIBS_INIT} |
53 | | - ${CMAKE_DL_LIBS} |
54 | | - opentelemetry_api) |
55 | | - |
56 | | - gtest_add_tests( |
57 | | - TARGET singleton_test |
58 | | - TEST_PREFIX singleton. |
59 | | - TEST_LIST singleton_test) |
60 | | - |
61 | | -endif() |
| 6 | +add_library(component_a STATIC component_a.cc) |
| 7 | +target_link_libraries(component_a opentelemetry_api) |
| 8 | + |
| 9 | +add_library(component_b STATIC component_b.cc) |
| 10 | +target_link_libraries(component_b opentelemetry_api) |
| 11 | + |
| 12 | +add_library(component_c SHARED component_c.cc) |
| 13 | +set_target_properties(component_c PROPERTIES CXX_VISIBILITY_PRESET default) |
| 14 | +target_link_libraries(component_c opentelemetry_api) |
| 15 | + |
| 16 | +add_library(component_d SHARED component_d.cc) |
| 17 | +set_target_properties(component_d PROPERTIES CXX_VISIBILITY_PRESET hidden) |
| 18 | +target_link_libraries(component_d opentelemetry_api) |
| 19 | + |
| 20 | +add_library(component_e SHARED component_e.cc) |
| 21 | +set_target_properties(component_e PROPERTIES CXX_VISIBILITY_PRESET default) |
| 22 | +target_link_libraries(component_e opentelemetry_api) |
| 23 | + |
| 24 | +add_library(component_f SHARED component_f.cc) |
| 25 | +set_target_properties(component_f PROPERTIES CXX_VISIBILITY_PRESET hidden) |
| 26 | +target_link_libraries(component_f opentelemetry_api) |
| 27 | + |
| 28 | +add_library(component_g SHARED component_g.cc) |
| 29 | +set_target_properties(component_g PROPERTIES CXX_VISIBILITY_PRESET default) |
| 30 | +target_link_libraries(component_g opentelemetry_api) |
| 31 | + |
| 32 | +add_library(component_h SHARED component_h.cc) |
| 33 | +set_target_properties(component_h PROPERTIES CXX_VISIBILITY_PRESET hidden) |
| 34 | +target_link_libraries(component_h opentelemetry_api) |
| 35 | + |
| 36 | +add_executable(singleton_test singleton_test.cc) |
| 37 | + |
| 38 | +# Not linking with component_g and component_h on purpose |
| 39 | +target_link_libraries( |
| 40 | + singleton_test |
| 41 | + component_a |
| 42 | + component_b |
| 43 | + component_c |
| 44 | + component_d |
| 45 | + component_e |
| 46 | + component_f |
| 47 | + ${GTEST_BOTH_LIBRARIES} |
| 48 | + ${CMAKE_THREAD_LIBS_INIT} |
| 49 | + ${CMAKE_DL_LIBS} |
| 50 | + opentelemetry_api) |
| 51 | + |
| 52 | +gtest_add_tests( |
| 53 | + TARGET singleton_test |
| 54 | + TEST_PREFIX singleton. |
| 55 | + TEST_LIST singleton_test) |
0 commit comments