mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Build OpenCL block only if enabled with -DENABLE_OPENCL=ON
This commit is contained in:
		| @@ -2056,13 +2056,15 @@ set_package_properties(OPENCL PROPERTIES | |||||||
|     PURPOSE "Used in some processing block implementations." |     PURPOSE "Used in some processing block implementations." | ||||||
|     TYPE OPTIONAL |     TYPE OPTIONAL | ||||||
| ) | ) | ||||||
|  | if(NOT OPENCL_FOUND) | ||||||
|  |     set(ENABLE_OPENCL OFF) | ||||||
|  | endif() | ||||||
| if(ENABLE_OPENCL) | if(ENABLE_OPENCL) | ||||||
|     find_package(OPENCL) |  | ||||||
|     if(DEFINED ENV{DISABLE_OPENCL}) |     if(DEFINED ENV{DISABLE_OPENCL}) | ||||||
|         set(DISABLE_OPENCL TRUE) |         set(DISABLE_OPENCL TRUE) | ||||||
|     endif() |     endif() | ||||||
|     if(DISABLE_OPENCL) |     if(DISABLE_OPENCL) | ||||||
|         set(OPENCL_FOUND FALSE) |         set(ENABLE_OPENCL OFF) | ||||||
|     else() |     else() | ||||||
|         if(OPENCL_FOUND) |         if(OPENCL_FOUND) | ||||||
|             message(STATUS "OpenCL has been found and will be used by some processing blocks") |             message(STATUS "OpenCL has been found and will be used by some processing blocks") | ||||||
| @@ -2070,7 +2072,7 @@ if(ENABLE_OPENCL) | |||||||
|         endif() |         endif() | ||||||
|     endif() |     endif() | ||||||
|     if(ENABLE_GENERIC_ARCH) |     if(ENABLE_GENERIC_ARCH) | ||||||
|         set(OPENCL_FOUND FALSE) |         set(ENABLE_OPENCL OFF) | ||||||
|         message(STATUS "ENABLE_GENERIC_ARCH is set to ON so the use of OpenCL has been disabled.") |         message(STATUS "ENABLE_GENERIC_ARCH is set to ON so the use of OpenCL has been disabled.") | ||||||
|     endif() |     endif() | ||||||
|     if(NOT OPENCL_FOUND) |     if(NOT OPENCL_FOUND) | ||||||
|   | |||||||
| @@ -111,7 +111,7 @@ target_link_libraries(algorithms_libs | |||||||
|         Glog::glog |         Glog::glog | ||||||
| ) | ) | ||||||
|  |  | ||||||
| if(OPENCL_FOUND) | if(ENABLE_OPENCL) | ||||||
|     target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL) |     target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL) | ||||||
|     target_include_directories(algorithms_libs PUBLIC |     target_include_directories(algorithms_libs PUBLIC | ||||||
|         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/opencl |         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/opencl | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez