Skip to content

Commit 0c81fc7

Browse files
authored
Merge pull request #6 from edg-l/try-ci-2
fix ci somewhat
2 parents d02f9d2 + b9e6d83 commit 0c81fc7

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

.clangd

-2
This file was deleted.

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/target
44
compile_commands.json
55
doc
6+
.clangd

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Read the documentation at https://danacus.gitlab.io/tblgen-rs/tblgen/.
1313

1414
## Supported LLVM Versions
1515

16-
An installation of LLVM is required to use this crate. Both LLVM 16 and 17 are supported and can be selected using feature flags.
16+
An installation of LLVM is required to use this crate. Both LLVM 16, 17 and 18 are supported and can be selected using feature flags.
1717

1818
The `TABLEGEN_<version>_PREFIX` environment variable can be used to specify a custom directory of the LLVM installation.

build.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ fn run() -> Result<(), Box<dyn Error>> {
7575
println!("cargo:rustc-link-lib={}", name);
7676
}
7777

78-
std::env::set_var("CXXFLAGS", llvm_config("--cxxflags")?);
79-
std::env::set_var("CFLAGS", llvm_config("--cflags")?);
78+
//std::env::set_var("CXXFLAGS", llvm_config("--cxxflags")?);
79+
//std::env::set_var("CFLAGS", llvm_config("--cflags")?);
8080
println!("cargo:rustc-link-search={}", &env::var("OUT_DIR")?);
8181

8282
cc::Build::new()
@@ -89,8 +89,9 @@ fn run() -> Result<(), Box<dyn Error>> {
8989
.cpp(true)
9090
.include("cc/include")
9191
.include(llvm_config("--includedir")?)
92-
// .flag("-MJcompile_commands.o.json")
93-
.opt_level(3)
92+
.flag(&llvm_config("--cxxflags")?)
93+
.flag("-Wno-unused-parameter")
94+
.std("c++17")
9495
.compile("CTableGen");
9596

9697
println!("cargo:rustc-link-lib=static=CTableGen");

cc/lib/RecordKeeper.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ void tableGenRecordKeeperFree(TableGenRecordKeeperRef rk_ref) {
1919

2020
TableGenRecordKeeperIteratorRef
2121
tableGenRecordKeeperGetFirstClass(TableGenRecordKeeperRef rk_ref) {
22-
auto *it = new RecordMap::const_iterator(unwrap(rk_ref)->getClasses().begin());
22+
auto *it =
23+
new RecordMap::const_iterator(unwrap(rk_ref)->getClasses().begin());
2324
if (*it == unwrap(rk_ref)->getClasses().end()) {
2425
return nullptr;
2526
}
@@ -95,9 +96,9 @@ TableGenRecordRef tableGenRecordKeeperGetDef(TableGenRecordKeeperRef rk_ref,
9596
TableGenRecordVectorRef
9697
tableGenRecordKeeperGetAllDerivedDefinitions(TableGenRecordKeeperRef rk_ref,
9798
TableGenStringRef className) {
98-
return wrap(new ctablegen::RecordVector(
99-
std::move(unwrap(rk_ref)->getAllDerivedDefinitions(
100-
StringRef(className.data, className.len)))));
99+
return wrap(
100+
new ctablegen::RecordVector(unwrap(rk_ref)->getAllDerivedDefinitions(
101+
StringRef(className.data, className.len))));
101102
}
102103

103104
TableGenRecordRef tableGenRecordVectorGet(TableGenRecordVectorRef vec_ref,

tools/setup.sh

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ brew install llvm@$llvm_version z3
1010
echo TABLEGEN_180_PREFIX=$(brew --prefix)/opt/llvm@$llvm_version >>$GITHUB_ENV
1111
echo PATH=$(brew --prefix)/opt/llvm@$llvm_version/bin:$PATH >>$GITHUB_ENV
1212
echo LIBRARY_PATH=$(brew --prefix)/lib:$LIBRARY_PATH >>$GITHUB_ENV
13+
echo LD_LIBRARY_PATH=$(brew --prefix)/lib:$LD_LIBRARY_PATH >>$GITHUB_ENV

0 commit comments

Comments
 (0)