Skip to content
Snippets Groups Projects

[cmake] Do not add python flags unconditionally

Merged Carsten Gräser requested to merge cmake/cleanup-python-module into master
1 file
+ 1
5
Compare changes
  • Side-by-side
  • Inline
@@ -13,12 +13,8 @@ function(add_dune_pythonlibs_flags _targets)
if(Python3_FOUND)
target_link_libraries(${_target} PUBLIC ${Python3_LIBRARIES})
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Python3_INCLUDE_DIRS})
# backward compatibility with 2.7 core tests
elseif(PYTHONLIBS_FOUND)
target_link_libraries(${_target} PUBLIC ${PYTHON_LIBRARIES})
set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS})
endif()
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS "HAVE_PYTHON")
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_OPTIONS "-fno-strict-aliasing")
endif()
endforeach(_target ${_targets})
endfunction(add_dune_pythonlibs_flags)
Loading