@@ -36,133 +36,4 @@ set( backend_reference_srcs ${backend_reference_srcs}
3636 ${CMAKE_CURRENT_SOURCE_DIR} /io.cpp
3737 PARENT_SCOPE
3838)
39- ### BINARY-ONLY TARGETS: create the actual library with all code inside
40- ### but storing only the minimum interface definitions (e.g. no OMP);
41- ### no default backend is set!
42-
43- if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
44-
45- # alias target for basic propagation of headers and definitions
46- # from existing header target, which depends on the enabled backends;
47- # use the most advanced ones, i.e. those of reference_omp if available
48- if ( WITH_OMP_BACKEND_HEADERS )
49- set ( backend_shmem_base_headers backend_reference_omp_headers)
50- elseif ( WITH_REFERENCE_BACKEND_HEADERS )
51- set ( backend_shmem_base_headers backend_reference_headers )
52- endif ()
53-
54- ## STATIC
55- make_reference_target( backend_shmem_static STATIC "shmem" )
56- target_link_libraries ( backend_shmem_static PRIVATE ${backend_shmem_base_headers} )
57- # this is the actual binary file, i.e. the one to be installed
58- install ( TARGETS backend_shmem_static
59- EXPORT GraphBLASTargets
60- ARCHIVE DESTINATION "${SHMEM_BACKEND_INSTALL_DIR} "
61- )
62-
63- ## DYNAMIC
64- make_reference_target( backend_shmem_shared SHARED "shmem" )
65- target_link_libraries ( backend_shmem_shared PRIVATE ${backend_shmem_base_headers} )
66-
67- install ( TARGETS backend_shmem_shared
68- EXPORT GraphBLASTargets
69- LIBRARY DESTINATION "${SHMEM_BACKEND_INSTALL_DIR} "
70- )
71-
72- add_dependencies ( libs backend_shmem_static )
73- add_dependencies ( libs backend_shmem_shared )
74- endif ()
75-
76-
77- ### CONSUMABLE TARGETS
78- ### i.e. targets with the default backend already set in the compilation interface:
79- ### if you import one of them, than it is already selected as a backend
80-
81- if ( WITH_REFERENCE_BACKEND )
82-
83- ## reference static
84- if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
85- # with CMake 3.19 or higher interface targets can inherit output properties like filename;
86- # hence, just do that and link the relevant libraries as interface dependencies
87- add_library ( backend_reference_static INTERFACE )
88- target_link_libraries ( backend_reference_static INTERFACE backend_shmem_static )
89- target_link_libraries ( backend_reference_static INTERFACE backend_reference_headers )
90- else ()
91- # otherwise, we must create a dedicated binary
92- make_reference_target( backend_reference_static STATIC "reference" )
93- target_link_libraries ( backend_reference_static PUBLIC backend_reference_headers )
94- add_dependencies ( libs backend_reference_static )
95- endif ()
96- # add the suitable definitions for backend selection for users' targets to get them automatically
97- target_compile_definitions ( backend_reference_static INTERFACE "${REFERENCE_SELECTION_DEFS} " )
98-
99- install ( TARGETS backend_reference_static
100- EXPORT GraphBLASTargets
101- ARCHIVE DESTINATION "${SHMEM_BACKEND_INSTALL_DIR} "
102- )
103-
104- ## reference shared
105- if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
106- add_library ( backend_reference_shared INTERFACE )
107- target_link_libraries ( backend_reference_shared INTERFACE backend_shmem_shared )
108- target_link_libraries ( backend_reference_shared INTERFACE backend_reference_headers )
109- else ()
110- make_reference_target( backend_reference_shared SHARED "reference" )
111- target_link_libraries ( backend_reference_shared PUBLIC backend_reference_headers )
112- add_dependencies ( libs backend_reference_shared )
113- endif ()
114- target_compile_definitions ( backend_reference_shared INTERFACE "${REFERENCE_SELECTION_DEFS} " )
115-
116- install ( TARGETS backend_reference_shared
117- EXPORT GraphBLASTargets
118- LIBRARY DESTINATION "${SHMEM_BACKEND_INSTALL_DIR} "
119- )
120-
121- # this is an alias for add_grb_executables() to select the backend to link against
122- # DO NOT CHANGE THE ALIAS NAME!
123- add_library ( "${REFERENCE_BACKEND_DEFAULT_NAME} " ALIAS backend_reference_static )
124-
125- endif ( WITH_REFERENCE_BACKEND )
126-
127- if ( WITH_OMP_BACKEND )
128-
129- ## reference_omp static
130- if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
131- add_library ( backend_reference_omp_static INTERFACE )
132- target_link_libraries ( backend_reference_omp_static INTERFACE backend_shmem_static )
133- target_link_libraries ( backend_reference_omp_static INTERFACE backend_reference_omp_headers )
134- else ()
135- make_reference_target( backend_reference_omp_static STATIC "reference_omp" )
136- target_link_libraries ( backend_reference_omp_static PUBLIC backend_reference_omp_headers )
137- add_dependencies ( libs backend_reference_omp_static )
138- endif ()
139- target_compile_definitions ( backend_reference_omp_static INTERFACE "${REFERENCE_OMP_SELECTION_DEFS} " )
140-
141- install ( TARGETS backend_reference_omp_static
142- EXPORT GraphBLASTargets
143- ARCHIVE DESTINATION "${SHMEM_BACKEND_INSTALL_DIR} "
144- )
145-
146- ## reference_omp shared
147- if ( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
148- add_library ( backend_reference_omp_shared INTERFACE )
149- target_link_libraries ( backend_reference_omp_shared INTERFACE backend_shmem_shared )
150- target_link_libraries ( backend_reference_omp_shared INTERFACE backend_reference_omp_headers )
151- else ()
152- make_reference_target( backend_reference_omp_shared SHARED "reference_omp" )
153- target_link_libraries ( backend_reference_omp_shared PUBLIC backend_reference_omp_headers )
154- add_dependencies ( libs backend_reference_omp_shared )
155- endif ()
156- target_compile_definitions ( backend_reference_omp_shared INTERFACE "${REFERENCE_OMP_SELECTION_DEFS} " )
157-
158- install ( TARGETS backend_reference_omp_shared
159- EXPORT GraphBLASTargets
160- LIBRARY DESTINATION "${SHMEM_BACKEND_INSTALL_DIR} "
161- )
162-
163- # this is an alias for add_grb_executables() to select the backend to link against
164- # DO NOT CHANGE THE ALIAS NAME!
165- add_library ( "${REFERENCE_OMP_BACKEND_DEFAULT_NAME} " ALIAS backend_reference_omp_static )
166-
167- endif ( WITH_OMP_BACKEND )
16839
0 commit comments