Skip to content

Commit c4b0f57

Browse files
authored
Add glj_no_aot_stdlib build tag to omit aot stdlib (#106)
`go build --tags glj_no_aot_stdlib` builds glojure without the AOT go standard library. Signed-off-by: James Hamlin <[email protected]>
1 parent 451a33a commit c4b0f57

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

pkg/glj/init-aot.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build !glj_no_aot_stdlib
2+
3+
package glj
4+
5+
import (
6+
// Add NS loaders for the standard library.
7+
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/core"
8+
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/core/async"
9+
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/go/io"
10+
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/protocols"
11+
)

pkg/glj/init.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ import (
88
_ "github.com/glojurelang/glojure/pkg/gen/gljimports"
99
"github.com/glojurelang/glojure/pkg/lang"
1010

11-
// Add NS loaders for the standard library.
12-
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/core"
13-
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/core/async"
14-
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/go/io"
15-
_ "github.com/glojurelang/glojure/pkg/stdlib/glojure/protocols"
16-
1711
"github.com/glojurelang/glojure/pkg/runtime"
1812
)
1913

pkg/runtime/envinit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func NewEnvironment(opts ...EvalOption) lang.Environment {
120120
// Workaround to ensure namespaces that are required by core are loaded.
121121
// TODO: AOT should identify this dependency and generate code to load it.
122122
if useAot {
123-
RT.Load("glojure/core/protocols")
123+
RT.Load("glojure/protocols")
124124
RT.Load("glojure/string")
125125
RT.Load("glojure/go/io")
126126
}

0 commit comments

Comments
 (0)