diff options
author | Raffi Enficiaud <raffi.enficiaud@mines-paris.org> | 2019-06-24 18:17:47 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-06-25 11:24:01 (GMT) |
commit | c2595a4958963e3cdd5276420a15a7735176c50d (patch) | |
tree | 65173cd993dea41f2997f677dcf1d5f7481b4fe9 /Modules | |
parent | 5835f553be5c159d9e3075ccb19c26be64e9cad5 (diff) | |
download | CMake-c2595a4958963e3cdd5276420a15a7735176c50d.zip CMake-c2595a4958963e3cdd5276420a15a7735176c50d.tar.gz CMake-c2595a4958963e3cdd5276420a15a7735176c50d.tar.bz2 |
FindMatlab: removing spaces in compiler define
Spaces in `DLL_EXPORT_SYM=__attribute__ ((visibility (\"default\")))`
are causing a compilation error.
Fixes: #19279
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMatlab.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 3547642..bcc7f67 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1053,7 +1053,7 @@ function(matlab_add_mex) # This one is weird, it might be a bug in <mex.h> for R2018b. When compiling with # -fvisibility=hidden, the symbol `mexFunction` cannot be exported. Reading the # source code for <mex.h>, it seems that the preprocessor macro `MW_NEEDS_VERSION_H` - # needs to be defined for `__attribute__ ((visibility("default")))` to be added + # needs to be defined for `__attribute__((visibility("default")))` to be added # in front of the declaration of `mexFunction`. In previous versions of MATLAB this # was not the case, there `DLL_EXPORT_SYM` needed to be defined. # Adding `-fvisibility=hidden` to the `mex` command causes the build to fail. @@ -1089,11 +1089,13 @@ function(matlab_add_mex) set(_link_flags "${_link_flags} -Wl,${_export_flag_name},${_file}") endforeach() + # The `mex` command doesn't add this define. It is specified here in order + # to export the symbol in case the client code decides to hide its symbols set_target_properties(${${prefix}_NAME} PROPERTIES - DEFINE_SYMBOL "DLL_EXPORT_SYM=__attribute__ ((visibility (\"default\")))" + DEFINE_SYMBOL "DLL_EXPORT_SYM=__attribute__((visibility(\"default\")))" LINK_FLAGS "${_link_flags}" - ) # The `mex` command doesn't add this define. Is it necessary? + ) endif() |