FindMatlab: Add SYSTEM include flag for matlab_add_mex

Add the `SYSTEM` flag for include directories provided by MATLAB, as the
the pragmas used are not compatible with GCC and generate a warning.

Fixes: #24166
This commit is contained in:
Jorrit Olthuis
2022-12-20 18:56:34 +01:00
committed by Brad King
parent 51a0292d9c
commit 6683c20f22

View File

@@ -1187,7 +1187,7 @@ function(matlab_add_mex)
${${prefix}_UNPARSED_ARGUMENTS})
endif()
target_include_directories(${${prefix}_NAME} PRIVATE ${Matlab_INCLUDE_DIRS})
target_include_directories(${${prefix}_NAME} SYSTEM PRIVATE ${Matlab_INCLUDE_DIRS})
if(NOT ${prefix}_NO_IMPLICIT_LINK_TO_MATLAB_LIBRARIES)
if(Matlab_HAS_CPP_API)