Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
feat: allow @[defaultTarget] extern_lib
Browse files Browse the repository at this point in the history
  • Loading branch information
tydeu committed Jun 10, 2022
1 parent 320b691 commit 6ab6051
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lake/DSL/Attributes.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ initialize leanLibAttr : TagAttribute ←
initialize leanExeAttr : TagAttribute ←
registerTagAttribute `leanExe "mark a definition as a Lake Lean executable target configuration"

initialize externLibAttr : TagAttribute ←
registerTagAttribute `externLib "mark a definition as a Lake external library target"

initialize defaultTargetAttr : TagAttribute ←
registerTagAttribute `defaultTarget "mark a Lake target as the package's default"
fun name => do
let valid ← getEnv <&> fun env =>
leanLibAttr.hasTag env name || leanExeAttr.hasTag env name
leanLibAttr.hasTag env name ||
leanExeAttr.hasTag env name ||
externLibAttr.hasTag env name
unless valid do
throwError "attribute `defaultTarget` can only be used on a target (e.g., `lean_lib`, `lean_exe`)"

initialize externLibAttr : TagAttribute ←
registerTagAttribute `externLib "mark a definition as a Lake external library target"

0 comments on commit 6ab6051

Please sign in to comment.