diff options
author | Ryan Volz <ryan.volz@gmail.com> | 2020-09-14 10:43:20 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2020-10-20 06:54:30 -0400 |
commit | 4e99c4e7f1639c554d0617542cff993b4fd08069 (patch) | |
tree | f94397fb7a58587288042fd625325d95ed4a63cd /cmake | |
parent | 8bfdd6868e2006d3b92327f103ba4bffa7efeac7 (diff) |
cmake: Fix pybind11 compiler definitions with MSVC.
-Wall is not set for MSVC, and -Wno-unused-variable doesn't exist, so
put it behind an if statement.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/GrPybind.cmake | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cmake/Modules/GrPybind.cmake b/cmake/Modules/GrPybind.cmake index d6f5184b23..91aeac5a16 100644 --- a/cmake/Modules/GrPybind.cmake +++ b/cmake/Modules/GrPybind.cmake @@ -40,7 +40,11 @@ target_include_directories(${name}_python PUBLIC ${PYBIND11_INCLUDE_DIR} ) target_link_libraries(${name}_python PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} gnuradio-${MODULE_NAME}) -target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates +endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_dependencies(${name}_python ${name}_docstrings) endmacro(GR_PYBIND_MAKE) @@ -153,7 +157,11 @@ target_include_directories(${name}_python PUBLIC ${PYBIND11_INCLUDE_DIR} ) target_link_libraries(${name}_python PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} gnuradio-${MODULE_NAME}) -target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates +endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(NOT SNDFILE_FOUND AND ${name} STREQUAL blocks) target_compile_options(${name}_python PRIVATE -DNO_WAVFILE) endif() @@ -277,7 +285,11 @@ target_include_directories(${name}_python PUBLIC ${PYBIND11_INCLUDE_DIR} ) target_link_libraries(${name}_python PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} gnuradio-${MODULE_NAME}) -target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_compile_options(${name}_python PRIVATE -Wno-unused-variable) # disable warnings for docstring templates +endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_dependencies(${name}_python ${name}_docstrings ${regen_targets}) endmacro(GR_PYBIND_MAKE_OOT) |