diff options
author | Ryan Volz <ryan.volz@gmail.com> | 2021-09-20 16:20:25 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-09-27 10:40:53 -0400 |
commit | d9b07f9f1917d63a5df6d5502cbec3cfd5a0f164 (patch) | |
tree | 5f0c443908d97c2fd24ca426fd4707cfe6142a5a | |
parent | 7a329159d4c728431cffa63f02e5a9ac5b9c67c0 (diff) |
runtime: Add NOMINMAX def on common-precompiled-headers when using MSVC
This fixes compilation with MSVC because of the use of min/max
functions in the precompiled headers.
Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
-rw-r--r-- | gnuradio-runtime/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gnuradio-runtime/CMakeLists.txt b/gnuradio-runtime/CMakeLists.txt index 937eba17f4..83705cd83c 100644 --- a/gnuradio-runtime/CMakeLists.txt +++ b/gnuradio-runtime/CMakeLists.txt @@ -58,6 +58,13 @@ if(ENABLE_COMMON_PCH) $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> ) + if(MSVC) + target_compile_definitions(common-precompiled-headers PUBLIC + # disables stupidity and enables std::min and std::max + -DNOMINMAX + ) + endif(MSVC) + target_precompile_headers( common-precompiled-headers PUBLIC |