Browse Source

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
Jorrit Olthuis 3 years ago
parent
commit
6683c20f22
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/FindMatlab.cmake

+ 1 - 1
Modules/FindMatlab.cmake

@@ -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)