From 4ec498514c10af07a39f483d8f39219ef563dcc7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 2 Aug 2019 14:59:05 +0200 Subject: [PATCH] Build OpenCL block only if enabled with -DENABLE_OPENCL=ON --- src/algorithms/acquisition/adapters/CMakeLists.txt | 2 +- src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt | 4 ++-- src/algorithms/libs/CMakeLists.txt | 2 +- src/core/receiver/CMakeLists.txt | 2 +- src/tests/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index 40eef1b52..745e134b4 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -76,7 +76,7 @@ if(ENABLE_FPGA) ) endif() -if(OPENCL_FOUND) +if(ENABLE_OPENCL) set(ACQ_ADAPTER_SOURCES ${ACQ_ADAPTER_SOURCES} gps_l1_ca_pcps_opencl_acquisition.cc diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index ccea93400..ccd6e4e6c 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -44,7 +44,7 @@ if(ENABLE_FPGA) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_acquisition_fpga.h) endif() -if(OPENCL_FOUND) +if(ENABLE_OPENCL) set(ACQ_GR_BLOCKS_SOURCES ${ACQ_GR_BLOCKS_SOURCES} pcps_opencl_acquisition_cc.cc) set(ACQ_GR_BLOCKS_HEADERS ${ACQ_GR_BLOCKS_HEADERS} pcps_opencl_acquisition_cc.h) endif() @@ -97,7 +97,7 @@ if(CMAKE_BUILD_TYPE MATCHES Rel) ) endif() -if(OPENCL_FOUND) +if(ENABLE_OPENCL) target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL) target_include_directories(acquisition_gr_blocks PUBLIC diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 190de9af7..ff0695985 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -67,7 +67,7 @@ set(GNSS_SPLIBS_HEADERS geofunctions.h ) -if(OPENCL_FOUND) +if(ENABLE_OPENCL) set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES} opencl/fft_execute.cc # Needs OpenCL opencl/fft_setup.cc # Needs OpenCL diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index ee83488d8..b91ce963f 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -109,7 +109,7 @@ if(ENABLE_FLEXIBAND) target_compile_definitions(core_receiver PRIVATE -DFLEXIBAND_DRIVER=1) endif() -if(OPENCL_FOUND) +if(ENABLE_OPENCL) message(STATUS "Adding processing blocks implemented using OpenCL") target_link_libraries(core_receiver PUBLIC algorithms_libs OpenCL::OpenCL) target_compile_definitions(core_receiver PRIVATE -DOPENCL_BLOCKS=1) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 021966a1a..d8d21171a 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -149,7 +149,7 @@ if(OPENSSL_FOUND) add_definitions(-DUSE_OPENSSL_FALLBACK=1) endif() -if(OPENCL_FOUND) +if(ENABLE_OPENCL) add_definitions(-DOPENCL_BLOCKS_TEST=1) endif()