diff options
author | Sean Warren <s.warren@garvan.org.au> | 2018-09-26 05:17:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-26 11:54:01 (GMT) |
commit | 9a56ed3438f652ec526afabeab87e04f330e4724 (patch) | |
tree | 857d3e3d701bdc087d710b6a650b1116b987801c /Modules/FindMatlab.cmake | |
parent | 6c57f6b347f2acf19ef043e38463ac03919594f3 (diff) | |
download | CMake-9a56ed3438f652ec526afabeab87e04f330e4724.zip CMake-9a56ed3438f652ec526afabeab87e04f330e4724.tar.gz CMake-9a56ed3438f652ec526afabeab87e04f330e4724.tar.bz2 |
FindMatlab: Explicitly export mexFunction in MSVC
Fixes: #18391
Diffstat (limited to 'Modules/FindMatlab.cmake')
-rw-r--r-- | Modules/FindMatlab.cmake | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 4565076..da832ce 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -996,6 +996,20 @@ function(matlab_add_mex) endif() # documentation # entry point in the mex file + taking care of visibility and symbol clashes. + if (MSVC) + get_target_property( + _previous_link_flags + ${${prefix}_NAME} + LINK_FLAGS) + if(NOT _previous_link_flags) + set(_previous_link_flags) + endif() + + set_target_properties(${${prefix}_NAME} + PROPERTIES + LINK_FLAGS "${_previous_link_flags} /EXPORT:mexFunction") + endif() + if(WIN32) set_target_properties(${${prefix}_NAME} PROPERTIES |