Merge pull request #10 from funatsufumiya/main
fix: macos path and dll problem (partially)
This commit is contained in:
commit
e7e5dffd0a
BIN
bin/macos/libhmm_dll_macos.so
Normal file → Executable file
BIN
bin/macos/libhmm_dll_macos.so
Normal file → Executable file
Binary file not shown.
BIN
bin/macos/libhmm_dll_macos_arm64.so
Normal file → Executable file
BIN
bin/macos/libhmm_dll_macos_arm64.so
Normal file → Executable file
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
local ffi = require( "ffi" )
|
local ffi = require( "ffi" )
|
||||||
|
|
||||||
local libs = ffi_hmm_dll or {
|
local libs = ffi_hmm_dll or {
|
||||||
OSX = { x64 = "hmm_dll" },
|
OSX = { x64 = "hmm_dll_macos.so", arm64 = "hmm_dll_macos_arm64.so" },
|
||||||
Windows = { x64 = "hmm_dll.dll" },
|
Windows = { x64 = "hmm_dll.dll" },
|
||||||
Linux = { x64 = "hmm_dll.so", arm = "hmm_dll.so" },
|
Linux = { x64 = "hmm_dll.so", arm = "hmm_dll.so" },
|
||||||
BSD = { x64 = "hmm_dll.so" },
|
BSD = { x64 = "hmm_dll.so" },
|
||||||
|
|||||||
@ -4,7 +4,7 @@ local ffi = require( "ffi" )
|
|||||||
|
|
||||||
local sokol_filename = _G.SOKOL_DLL or "sokol_dll"
|
local sokol_filename = _G.SOKOL_DLL or "sokol_dll"
|
||||||
local libs = ffi_sokol_app or {
|
local libs = ffi_sokol_app or {
|
||||||
OSX = { x64 = sokol_filename..".so" },
|
OSX = { x64 = sokol_filename.."_macos.so", arm64 = sokol_filename.."_macos_arm64.so" },
|
||||||
Windows = { x64 = sokol_filename..".dll" },
|
Windows = { x64 = sokol_filename..".dll" },
|
||||||
Linux = { x64 = "lib"..sokol_filename..".so", arm = "lib"..sokol_filename..".so" },
|
Linux = { x64 = "lib"..sokol_filename..".so", arm = "lib"..sokol_filename..".so" },
|
||||||
BSD = { x64 = sokol_filename..".so" },
|
BSD = { x64 = sokol_filename..".so" },
|
||||||
@ -13,7 +13,6 @@ local libs = ffi_sokol_app or {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local lib = ffi_sokol_app or libs[ ffi.os ][ ffi.arch ]
|
local lib = ffi_sokol_app or libs[ ffi.os ][ ffi.arch ]
|
||||||
print(lib)
|
|
||||||
local sokol_app = ffi.load( lib )
|
local sokol_app = ffi.load( lib )
|
||||||
|
|
||||||
-- just use LuaJIT ffi and lcpp together
|
-- just use LuaJIT ffi and lcpp together
|
||||||
|
|||||||
@ -2,7 +2,7 @@ local ffi = require( "ffi" )
|
|||||||
|
|
||||||
local sokol_filename = _G.SOKOL_DLL or "sokol_dll"
|
local sokol_filename = _G.SOKOL_DLL or "sokol_dll"
|
||||||
local libs = ffi_sokol_gfx or {
|
local libs = ffi_sokol_gfx or {
|
||||||
OSX = { x64 = sokol_filename..".so" },
|
OSX = { x64 = sokol_filename.."_macos.so", arm64 = sokol_filename.."_macos_arm64.so" },
|
||||||
Windows = { x64 = sokol_filename..".dll" },
|
Windows = { x64 = sokol_filename..".dll" },
|
||||||
Linux = { x64 = sokol_filename..".so", arm = sokol_filename..".so" },
|
Linux = { x64 = sokol_filename..".so", arm = sokol_filename..".so" },
|
||||||
BSD = { x64 = sokol_filename..".so" },
|
BSD = { x64 = sokol_filename..".so" },
|
||||||
|
|||||||
@ -2,7 +2,7 @@ local ffi = require( "ffi" )
|
|||||||
|
|
||||||
local sokol_filename = _G.SOKOL_GP_DLL or "sokol_gp_dll"
|
local sokol_filename = _G.SOKOL_GP_DLL or "sokol_gp_dll"
|
||||||
local libs = ffi_sokol_gfx or {
|
local libs = ffi_sokol_gfx or {
|
||||||
OSX = { x64 = sokol_filename..".so" },
|
OSX = { x64 = sokol_filename.."_macos.so", arm64 = sokol_filename.."_macos_arm64.so" },
|
||||||
Windows = { x64 = sokol_filename..".dll" },
|
Windows = { x64 = sokol_filename..".dll" },
|
||||||
Linux = { x64 = sokol_filename..".so", arm = sokol_filename..".so" },
|
Linux = { x64 = sokol_filename..".so", arm = sokol_filename..".so" },
|
||||||
BSD = { x64 = sokol_filename..".so" },
|
BSD = { x64 = sokol_filename..".so" },
|
||||||
|
|||||||
@ -2,7 +2,7 @@ local ffi = require( "ffi" )
|
|||||||
|
|
||||||
local sokol_filename = _G.SOKOL_DLL or "sokol_dll"
|
local sokol_filename = _G.SOKOL_DLL or "sokol_dll"
|
||||||
local libs = ffi_sokol_libs or {
|
local libs = ffi_sokol_libs or {
|
||||||
OSX = { x64 = sokol_filename..".so" },
|
OSX = { x64 = sokol_filename.."_macos.so", arm64 = sokol_filename.."_macos_arm64.so" },
|
||||||
Windows = { x64 = sokol_filename..".dll" },
|
Windows = { x64 = sokol_filename..".dll" },
|
||||||
Linux = { x64 = sokol_filename..".so", arm = sokol_filename..".so" },
|
Linux = { x64 = sokol_filename..".so", arm = sokol_filename..".so" },
|
||||||
BSD = { x64 = sokol_filename..".so" },
|
BSD = { x64 = sokol_filename..".so" },
|
||||||
|
|||||||
18
projects/examples/run_sample.sh
Normal file → Executable file
18
projects/examples/run_sample.sh
Normal file → Executable file
@ -1,15 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||||
|
PROJECT_PATH="$(dirname $(dirname "$SCRIPT_PATH"))"
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
echo "Running Linux..."
|
echo "Running Linux..."
|
||||||
export LD_LIBRARY_PATH=../bin/linux/
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PROJECT_PATH/bin/linux"
|
||||||
../bin/linux/luajit ./samples/$1.lua
|
$PROJECT_PATH/bin/linux/luajit $SCRIPT_PATH/samples/$1.lua
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
echo "Running MaxOS..."
|
echo "Running MacOS..."
|
||||||
../bin/macos/luajit ./samples/$1.lua
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PROJECT_PATH/bin/macos"
|
||||||
|
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$PROJECT_PATH/bin/macos"
|
||||||
|
$PROJECT_PATH/bin/macos/luajit $SCRIPT_PATH/samples/$1.lua
|
||||||
elif [[ "$OSTYPE" == "win32" ]]; then
|
elif [[ "$OSTYPE" == "win32" ]]; then
|
||||||
echo "Running Windows..."
|
echo "Running Windows..."
|
||||||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../bin/linux
|
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PROJECT_PATH/bin/linux
|
||||||
../bin/win64/luajit ./samples/$1.lua
|
$PROJECT_PATH/bin/win64/luajit $SCRIPT_PATH/samples/$1.lua
|
||||||
else
|
else
|
||||||
echo "OS Type not found."
|
echo "OS Type not found."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -54,11 +54,13 @@ dirtools.add_default_paths = function(path)
|
|||||||
["Linux"] = "linux",
|
["Linux"] = "linux",
|
||||||
["Windows"] = "win64",
|
["Windows"] = "win64",
|
||||||
["MacOSX"] = "macos",
|
["MacOSX"] = "macos",
|
||||||
|
["OSX"] = "macos",
|
||||||
}
|
}
|
||||||
local extensions = {
|
local extensions = {
|
||||||
["Linux"] = "so",
|
["Linux"] = "so",
|
||||||
["Windows"] = "dll",
|
["Windows"] = "dll",
|
||||||
["MacOSX"] = "so",
|
["MacOSX"] = "so",
|
||||||
|
["OSX"] = "so",
|
||||||
}
|
}
|
||||||
|
|
||||||
package.cpath = package.cpath..";"..path.."bin/"..folders[ffi.os].."/?."..extensions[ffi.os]
|
package.cpath = package.cpath..";"..path.."bin/"..folders[ffi.os].."/?."..extensions[ffi.os]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user