Added in native modules suffixes. (#1111)

* Added in native modules with suffixes, giving priority to those with matching architectures and platforms.

* PowerPC isn't x86, and it's x86_64.

* Changed things over to allow compiler to set a tuple, makes more sense from a build perspective.

* Spelling mistake.

* Added in arm target tuples.
This commit is contained in:
Adam
2022-09-18 18:27:50 -04:00
committed by GitHub
parent 4134b30ffd
commit 5ada80b9df
2 changed files with 29 additions and 2 deletions
+4 -2
View File
@@ -21,8 +21,10 @@ package.path = DATADIR .. '/?/init.lua;' .. package.path
package.path = USERDIR .. '/?.lua;' .. package.path
package.path = USERDIR .. '/?/init.lua;' .. package.path
local dynamic_suffix = PLATFORM == "Mac OS X" and 'lib' or (PLATFORM == "Windows" and 'dll' or 'so')
package.cpath = DATADIR .. '/?.' .. dynamic_suffix .. ";" .. USERDIR .. '/?.' .. dynamic_suffix
local suffix = PLATFORM == "Mac OS X" and 'lib' or (PLATFORM == "Windows" and 'dll' or 'so')
package.cpath = USERDIR .. '/?.' .. ARCH .. "." .. suffix .. ";" .. DATADIR .. '/?.' .. ARCH .. "." .. suffix ..
USERDIR .. '/?.' .. suffix .. ";" .. DATADIR .. '/?.' .. suffix
package.native_plugins = {}
package.searchers = { package.searchers[1], package.searchers[2], function(modname)
local path = package.searchpath(modname, package.cpath)