summaryrefslogtreecommitdiff
path: root/libs/ardour/control_protocol_manager.cc
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2014-03-21 14:54:21 +0000
committerJohn Emmas <johne53@tiscali.co.uk>2014-03-21 14:54:21 +0000
commit0daae2ec91f8c8324e8db4e9583d1ce1eca6524a (patch)
treeeec01cddd278330f4be1354cb41d66a9471ff604 /libs/ardour/control_protocol_manager.cc
parent640bd36906dffb867b470f747ad4bc500a8dfa5c (diff)
When finding the control surface DLLs (MSVC built), make sure we only find ones that match our build target
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r--libs/ardour/control_protocol_manager.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index f3dc4f8c17..49b3d07761 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -245,10 +245,33 @@ ControlProtocolManager::discover_control_protocols ()
{
vector<std::string> cp_modules;
+#ifdef COMPILER_MSVC
+ /**
+ * Different build targets (Debug / Release etc) use different versions
+ * of the 'C' runtime (which can't be 'mixed & matched'). Therefore, in
+ * case the supplied search path contains multiple version(s) of a given
+ * module, only select the one(s) which match the current build target
+ */
+ #if defined (_DEBUG)
+ Glib::PatternSpec dll_extension_pattern("*D.dll");
+ #elif defined (RDC_BUILD)
+ Glib::PatternSpec dll_extension_pattern("*RDC.dll");
+ #elif defined (_WIN64)
+ Glib::PatternSpec dll_extension_pattern("*64.dll");
+ #else
+ Glib::PatternSpec dll_extension_pattern("*32.dll");
+ #endif
+#else
+ Glib::PatternSpec dll_extension_pattern("*.dll");
+#endif
+
Glib::PatternSpec so_extension_pattern("*.so");
Glib::PatternSpec dylib_extension_pattern("*.dylib");
find_matching_files_in_search_path (control_protocol_search_path (),
+ dll_extension_pattern, cp_modules);
+
+ find_matching_files_in_search_path (control_protocol_search_path (),
so_extension_pattern, cp_modules);
find_matching_files_in_search_path (control_protocol_search_path (),