Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

Commit

Permalink
add cxx/ldFlags.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed May 16, 2024
1 parent 563a4ca commit 70721ac
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"files.watcherExclude": {
"**/target": true
}
},
"editor.formatOnSave": true,
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import chisel3.BlackBox
final case class CXXRTLOptions(
clockHz: Int,
blackboxes: Seq[Class[_ <: BlackBox]] = Seq(),
cxxFlags: Seq[String] = Seq(),
ldFlags: Seq[String] = Seq(),
)
12 changes: 9 additions & 3 deletions src/main/scala/ee/hrzn/chryse/tasks/CxxsimTask.scala
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ object CxxsimTask extends BaseTask {
cc,
"-o",
obj,
) ++ cxxOpts
) ++ cxxOpts ++ cxxrtlOptions.cxxFlags

// XXX: depend on what look like headers for now.
val cus = for {
Expand All @@ -161,7 +161,9 @@ object CxxsimTask extends BaseTask {
None,
cus.map(_.outPath),
binPath,
Seq("c++", "-o", binPath) ++ cxxOpts ++ cus.map(_.outPath),
Seq("c++", "-o", binPath) ++ cxxOpts ++ cus.map(
_.outPath,
) ++ cxxrtlOptions.ldFlags,
)
runCu("linking", linkCu)

Expand All @@ -188,7 +190,11 @@ object CxxsimTask extends BaseTask {
.filter(_.endsWith(ext))
}

private case class ClangdEntry(directory: String, file: String, arguments: Seq[String])
private case class ClangdEntry(
directory: String,
file: String,
arguments: Seq[String],
)
private object ClangdEntry {
implicit val rw: upickle.default.ReadWriter[ClangdEntry] =
upickle.default.macroRW
Expand Down

0 comments on commit 70721ac

Please sign in to comment.