Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 38 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ name: Go

on:
push:
branches: [ "main" ]
branches: [ "**" ]
pull_request:
branches: [ "main" ]
branches: [ "**" ]

jobs:

build:
runs-on: ubuntu-latest
test:
strategy:
matrix:
os:
- macos-latest
- ubuntu-24.04
llvm: [18]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4

Expand All @@ -21,11 +27,37 @@ jobs:
with:
go-version: '1.20'

- name: Install dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install llvm@${{matrix.llvm}} bdw-gc openssl libffi
brew link --force libffi
echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH

# llcppg dependencies
brew install cjson

- name: Install dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{matrix.llvm}} main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y llvm-${{matrix.llvm}}-dev clang-${{matrix.llvm}} libclang-${{matrix.llvm}}-dev lld-${{matrix.llvm}} pkg-config libgc-dev libssl-dev zlib1g-dev libffi-dev libcjson-dev
echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH

- name: Install LLGO
run: |
go install github.com/goplus/llgo/cmd/llgo@main

- name: Build
run: go build -v ./...

- name: Install llcppg dependencies
run: bash .github/workflows/install_llcppg_depend.sh

- name: Test
run: go test -v ./...

# - name: Install llcppg dependencies
# run: bash .github/workflows/install_llcppg_depend.sh

6 changes: 3 additions & 3 deletions .github/workflows/install_llcppg_depend.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e

llgo install ./chore/_xtool/llcppsymg
llgo install ./chore/_xtool/llcppsigfetch
go install ./chore/gogensig
llgo install ./_xtool/llcppsymg
llgo install ./_xtool/llcppsigfetch
go install ./cmd/gogensig
4 changes: 2 additions & 2 deletions _xtool/llcppsigfetch/parse/cvt_test/cvt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package cvttest
import (
"fmt"

"github.com/goplus/llcppg/_xtool/llcppsigfetch/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

func RunTest(testName string, testCases []string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestClassDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestDoc()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestEnumDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestFuncDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestScope()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestStructDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestTypeDefDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
import test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"

func main() {
TestUnionDecl()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions _xtool/llcppsigfetch/parse/cvt_test/type_test/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"fmt"
"os"

"github.com/goplus/llcppg/_xtool/llcppsigfetch/parse"
test "github.com/goplus/llcppg/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llcppg/ast"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse"
test "github.com/goplus/llgo/chore/_xtool/llcppsigfetch/parse/cvt_test"
"github.com/goplus/llgo/chore/llcppg/ast"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsigfetch/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c/cjson"
)

type dbgFlags = int
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/_cmptest/args_test/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/args"
"github.com/goplus/llcppg/_xtool/llcppsymg/args"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/_cmptest/clangutils_test/clangutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"os"

"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions _xtool/llcppsymg/_cmptest/config_test/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"runtime"
"strings"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/config"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llcppg/_xtool/llcppsymg/config"
"github.com/goplus/llcppg/_xtool/llcppsymg/config/cfgparse"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/_cmptest/parse_test/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sort"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions _xtool/llcppsymg/_cmptest/symbol_test/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"os"
"sort"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/symbol"
"github.com/goplus/llgo/chore/llcppg/types"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/symbol"
"github.com/goplus/llcppg/types"
"github.com/goplus/llgo/xtool/nm"
)

Expand Down
4 changes: 2 additions & 2 deletions _xtool/llcppsymg/_cmptest/symg_test/symg.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"os"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/symbol"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/symbol"
"github.com/goplus/llgo/xtool/nm"
)

Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"errors"
"unsafe"

"github.com/goplus/llcppg/types"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/chore/llcppg/types"
)

type Conf struct {
Expand Down
10 changes: 5 additions & 5 deletions _xtool/llcppsymg/llcppsymg.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"io"
"os"

"github.com/goplus/llgo/chore/_xtool/llcppsymg/args"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/symbol"
"github.com/goplus/llcppg/_xtool/llcppsymg/args"
"github.com/goplus/llcppg/_xtool/llcppsymg/config"
"github.com/goplus/llcppg/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/_xtool/llcppsymg/symbol"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion _xtool/llcppsymg/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strconv"
"strings"

"github.com/goplus/llcppg/_xtool/llcppsymg/clangutils"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/clang"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/clangutils"
)

type SymbolInfo struct {
Expand Down
8 changes: 4 additions & 4 deletions _xtool/llcppsymg/symbol/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"strings"
"unsafe"

"github.com/goplus/llcppg/_xtool/llcppsymg/config"
"github.com/goplus/llcppg/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llcppg/_xtool/llcppsymg/parse"
"github.com/goplus/llcppg/types"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/cjson"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/config/cfgparse"
"github.com/goplus/llgo/chore/_xtool/llcppsymg/parse"
"github.com/goplus/llgo/chore/llcppg/types"
"github.com/goplus/llgo/xtool/nm"
)

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ module github.com/goplus/llcppg

go 1.20

require (
github.com/goplus/llgo v0.9.7
)
require github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/goplus/llgo v0.9.7 h1:LRF2Fq9ts4QrVxOPZufexalbIoJ1oiBERjCWQ45wxbg=
github.com/goplus/llgo v0.9.7/go.mod h1:5Fs+08NslqofJ7xtOiIXugkurYOoQvY02ZkFNWA1uEI=
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589 h1:u0aqHCN6z+Md1FYB052ROjP/6PVlFBtWWuTi/LGuifs=
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589/go.mod h1:1phqPJEgr/uw59PRz/NB7s54OoP+NGjC6pz0HovT5JY=
Loading