[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why does the default cpath not have lib?.so in it?
- From: David Manura <dm.lua@...>
- Date: Tue, 13 Sep 2011 21:56:22 -0400
n Tue, Sep 13, 2011 at 11:39 AM, Sebastien Lai <237482@googlemail.com> wrote:
> You can remove the 'lib' prefix this way:
> SET_TARGET_PROPERTIES(${yourlib} PROPERTIES PREFIX "")
When building a Lua module, I recommend adding MODULE rather than
SHARED to the add_library command. I believe that also takes care of
omitting the PREFIX as a side-effect.
Modules loaded via Lua require should by convention not have the "lib"
prefix to avoid name conflicts with regular shared libraries not
intended to be loaded via require. For example, require "foo" might
load from foo.so in the package.cpath and in turn might itself be a
Lua wrapper around a regular C library "libfoo.so" in the OS library
path. Keeping Lua modules and regular C libraries in separate
directories may mitigate naming conflicts, but sometimes it's
convenient to keep them in the same directory (e.g. see Windows DLL
path lookup rules). Other operating systems may use different
prefixes too (e.g. PREFIX is "cyg" on Cygwin).