Browse Source

FindArmadillo: Fix wrapper linking with MSVC

Transitive linking does not work with MSVC, so we must link against both
Armadillo and its dependencies directly if `ARMA_USE_WRAPPER` is enabled.
Ryan Curtin 10 months ago
parent
commit
6745af99c8
1 changed files with 6 additions and 1 deletions
  1. 6 1
      Modules/FindArmadillo.cmake

+ 6 - 1
Modules/FindArmadillo.cmake

@@ -99,8 +99,13 @@ if(_ARMA_USE_WRAPPER)
   mark_as_advanced(ARMADILLO_LIBRARY)
   set(_ARMA_REQUIRED_VARS ARMADILLO_LIBRARY)
 else()
-  # Link directly to individual components.
   set(ARMADILLO_LIBRARY "")
+endif()
+
+# Transitive linking with the wrapper does not work with MSVC,
+# so we must *also* link against Armadillo's dependencies.
+if(NOT _ARMA_USE_WRAPPER OR MSVC)
+  # Link directly to individual components.
   foreach(pkg
       LAPACK
       BLAS