forked from rogchap/v8go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cgo.go
26 lines (22 loc) · 1.1 KB
/
cgo.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2019 Roger Chapman and the v8go contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package v8go
//go:generate clang-format -i --verbose -style=Chromium v8go.h v8go.cc
// #cgo CXXFLAGS: -fno-rtti -fPIC -std=c++17 -DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH -I${SRCDIR}/deps/include -Wall -DV8_ENABLE_SANDBOX
// #cgo LDFLAGS: -pthread -lv8
// #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/deps/darwin_x86_64
// #cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/deps/darwin_arm64
// #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/deps/linux_x86_64 -ldl
// #cgo linux,arm64 LDFLAGS: -L${SRCDIR}/deps/linux_arm64 -ldl
import "C"
// These imports forces `go mod vendor` to pull in all the folders that
// contain V8 libraries and headers which otherwise would be ignored.
// DO NOT REMOVE
import (
_ "github.com/sundeck-io/v8go/deps/darwin_arm64"
_ "github.com/sundeck-io/v8go/deps/darwin_x86_64"
_ "github.com/sundeck-io/v8go/deps/include"
_ "github.com/sundeck-io/v8go/deps/linux_arm64"
_ "github.com/sundeck-io/v8go/deps/linux_x86_64"
)