summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Müller <mmueller@gnuradio.org>2021-06-05 22:13:27 +0200
committermormj <34754695+mormj@users.noreply.github.com>2021-07-19 09:57:48 -0400
commit8224d05bdceb6060e450d2e50117b10b1e071dd3 (patch)
treec5f5a946943538c6c5f1456b3fd6e6e6e1ca5690
parentd7cb2b6befb27c640f0d6be4a1af75e7bdf454a5 (diff)
runtime: add common-precompiled-headers pseudotarget to link against
Idea: have a component that doesn't actually contribute any code of its own, but defines precompiled headers to be transitively included in gr-\* Signed-off-by: Marcus Müller <mmueller@gnuradio.org>
-rw-r--r--gnuradio-runtime/CMakeLists.txt30
-rw-r--r--gnuradio-runtime/lib/dummy.cc0
2 files changed, 30 insertions, 0 deletions
diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt
index 1332b9b341..937eba17f4 100644
--- a/gnuradio-runtime/CMakeLists.txt
+++ b/gnuradio-runtime/CMakeLists.txt
@@ -34,6 +34,36 @@ GR_REGISTER_COMPONENT("gnuradio-runtime" ENABLE_GNURADIO_RUNTIME
get_filename_component(GNURADIO_RUNTIME_PYTHONPATH
${CMAKE_SOURCE_DIR}/python ABSOLUTE
)
+########################################################################
+# Setup precompiled header pseudo-component
+########################################################################
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
+ set(GR_CMAKE_HAS_PCH ${CMAKE_VERSION})
+endif()
+
+GR_REGISTER_COMPONENT("common-precompiled-headers" ENABLE_COMMON_PCH
+ ENABLE_GNURADIO_RUNTIME
+ GR_CMAKE_HAS_PCH
+ )
+
+if(ENABLE_COMMON_PCH)
+ add_library(common-precompiled-headers
+ STATIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/dummy.cc
+ )
+ target_include_directories(common-precompiled-headers
+ PUBLIC
+ $<INSTALL_INTERFACE:include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
+ )
+
+ target_precompile_headers(
+ common-precompiled-headers
+ PUBLIC
+ $<$<COMPILE_LANGUAGE:CXX>:$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/gnuradio/top_block.h>>
+ )
+endif()
########################################################################
# Register controlport component
diff --git a/gnuradio-runtime/lib/dummy.cc b/gnuradio-runtime/lib/dummy.cc
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/gnuradio-runtime/lib/dummy.cc