fix: linking issues, explicitly link against libstdc++

This commit is contained in:
Erica Marigold 2024-07-18 16:24:48 +05:30
parent 3e906f1c0e
commit a0bf86ec76
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1
4 changed files with 30 additions and 5 deletions

View file

@ -2,7 +2,7 @@ package internal
/* /*
#cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include #cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include
#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM #cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++
#include <lua.h> #include <lua.h>
#include <lualib.h> #include <lualib.h>
#include <stdlib.h> #include <stdlib.h>

View file

@ -2,7 +2,7 @@ package internal
/* /*
#cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include #cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include
#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM #cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++
#include <lua.h> #include <lua.h>
#include <lualib.h> #include <lualib.h>
#include <stdlib.h> #include <stdlib.h>
@ -269,8 +269,5 @@ func PushInteger(L *C.lua_State, n lua_Integer) {
} }
// TODO: Vector 3 & 4 // TODO: Vector 3 & 4
func PushVector(L *C.lua_State, x float32, y float32, z float32) {
C.lua_pushvector(L, C.float(x), C.float(y), C.float(z))
}
// TODO: Rest of it // TODO: Rest of it

14
internal/vector3.go Normal file
View file

@ -0,0 +1,14 @@
//go:build !LUAU_VECTOR4
package internal
/*
#cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include
#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++
#include <lua.h>
*/
import "C"
func PushVector(L *C.lua_State, x float32, y float32, z float32) {
C.lua_pushvector(L, C.float(x), C.float(y), C.float(z))
}

14
internal/vector4.go Normal file
View file

@ -0,0 +1,14 @@
//go:build LUAU_VECTOR4
package internal
/*
#cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include
#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++
#include <lua.h>
*/
import "C"
func PushVector(L *C.lua_State, x float32, y float32, z float32, w float32) {
C.lua_pushvector(L, C.float(x), C.float(y), C.float(z), C.float(w))
}