mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-30 23:03:05 +00:00 
			
		
		
		
	Create OpenCL imported target
This commit is contained in:
		| @@ -49,16 +49,6 @@ if(OPENCL_FOUND) | ||||
|     set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) | ||||
| endif() | ||||
|  | ||||
|  | ||||
| if(OPENCL_FOUND) | ||||
|     include_directories(${OPENCL_INCLUDE_DIRS}) | ||||
|     if(OS_IS_MACOSX) | ||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") | ||||
|     else() | ||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| list(SORT ACQ_GR_BLOCKS_HEADERS) | ||||
| list(SORT ACQ_GR_BLOCKS_SOURCES) | ||||
|  | ||||
| @@ -84,7 +74,6 @@ target_link_libraries(acquisition_gr_blocks | ||||
|         channel_libs | ||||
|         acquisition_libs | ||||
|         core_system_parameters | ||||
|         ${OPT_LIBRARIES} | ||||
|     PRIVATE | ||||
|         Gflags::gflags | ||||
|         Glog::glog | ||||
| @@ -101,7 +90,7 @@ target_include_directories(acquisition_gr_blocks | ||||
| ) | ||||
|  | ||||
| if(OPENCL_FOUND) | ||||
|     target_include_directories(acquisition_gr_blocks PUBLIC ${OPENCL_INCLUDE_DIRS}) | ||||
|     target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL) | ||||
| endif() | ||||
|  | ||||
| if(ENABLE_CLANG_TIDY) | ||||
|   | ||||
| @@ -63,6 +63,7 @@ | ||||
| #include <vector> | ||||
|  | ||||
| #ifdef __APPLE__ | ||||
| #define CL_SILENCE_DEPRECATION | ||||
| #include "opencl/cl.hpp" | ||||
| #else | ||||
| #include <CL/cl.hpp> | ||||
|   | ||||
| @@ -73,12 +73,6 @@ if(OPENCL_FOUND) | ||||
|         opencl/fft_setup.cc # Needs OpenCL | ||||
|         opencl/fft_kernelstring.cc # Needs OpenCL | ||||
|     ) | ||||
|     include_directories(${OPENCL_INCLUDE_DIRS}) | ||||
|     if(OS_IS_MACOSX) | ||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} "-framework OpenCL") | ||||
|     else() | ||||
|         set(OPT_LIBRARIES ${OPT_LIBRARIES} ${OPENCL_LIBRARIES}) | ||||
|     endif() | ||||
| endif() | ||||
|  | ||||
| list(SORT GNSS_SPLIBS_HEADERS) | ||||
| @@ -105,7 +99,6 @@ target_link_libraries(algorithms_libs | ||||
|         Gflags::gflags | ||||
|         Gnuradio::runtime | ||||
|         Gnuradio::blocks | ||||
|         ${OPT_LIBRARIES} | ||||
|     PRIVATE | ||||
|         core_system_parameters | ||||
|         Volk::volk ${ORC_LIBRARIES} | ||||
| @@ -113,6 +106,13 @@ target_link_libraries(algorithms_libs | ||||
|         Glog::glog | ||||
| ) | ||||
|  | ||||
| if(OPENCL_FOUND) | ||||
|     target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL) | ||||
|     target_include_directories(algorithms_libs PUBLIC | ||||
|         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/opencl | ||||
|     ) | ||||
| endif() | ||||
|  | ||||
| target_include_directories(algorithms_libs | ||||
|     PUBLIC | ||||
|         ${CMAKE_SOURCE_DIR}/src/core/interfaces | ||||
| @@ -145,7 +145,7 @@ add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h) | ||||
| if(${FILESYSTEM_FOUND}) | ||||
|     target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM=1) | ||||
|     if(${find_experimental}) | ||||
|         add_definitions(-DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) | ||||
|         target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1) | ||||
|     endif() | ||||
|     target_link_libraries(gnss_sdr_flags PRIVATE std::filesystem) | ||||
| else() | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -57,6 +57,7 @@ extern "C" | ||||
| #include <stdio.h> | ||||
|  | ||||
| #ifdef __APPLE__ | ||||
| #define CL_SILENCE_DEPRECATION | ||||
| #include <OpenCL/opencl.h> | ||||
| #else | ||||
| #include <CL/cl.h> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez