Bug #1761

loadable-module naming on macosx + cmake

Added by Anonymous 133 days ago.

Status:New Start:
Priority:Normal Due date:
Assigned to:jan % Done:

0%

Category:build_cmake
Target version:-
Pending:

No

Resolution:


Description

Modules get built as mod_foo.dylib on OSX (which is OK) but then the core tries to load them from mod_foo.so (which fails, of course).

This patch fixes the problem by changing the library type from SHARED to MODULE. The cmake docs say this shouldn't change the behavior on other systems. On OSX it has the useful effect of changing the default suffix to .so. (Maybe it would be more "OSX-y" to leave it at .dylib and have the plugin code know its host system's module suffix more reliably, but this change works and is simple.)

A MODULE library no longer gets affected by the CMAKE_SHARED_LIBRARY_PREFIX variable, so the other change here is to set the prefix property on the module target directly, instead of globally.

I've tested this patch in a handful of configurations on OSX (static, shared). Someone should probably verify that it doesn't break Win32, though, since that's the other special-cased system type near this change.

-- wiml

modulename.patch - fixes loadable-module naming on mac os x -- wiml (1.1 KB) Anonymous, 08/27/2008 06:32 AM

Also available in: Atom PDF