Skip to content

Commit 8a6ae41

Browse files
Fix libgc pkg-config name for version discovery (#15636)
We define different names for `pkg-config` in the `Link` annotations of `LibGC` depending on target, but used a fixed name in version discovery. This patch re-uses the name declared in the annotation. We need to filter for the appropriate annotation because there are multiple ones. Unfortunately, I haven't found an easier way to do this. Co-authored-by: Quinton Miller <[email protected]>
1 parent 0122e33 commit 8a6ae41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gc/boehm.cr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ require "crystal/tracing"
5050
{% end %}
5151
lib LibGC
5252
{% unless flag?(:win32) %}
53-
VERSION = {{ `pkg-config bdw-gc --silence-errors --modversion || printf "0.0.0"`.chomp.stringify }}
53+
{% pkg_config_name = ((ann = LibGC.annotations(Link).find(&.["pkg_config"])) && ann["pkg_config"]) || ((ann = LibGC.annotations(Link).find(&.[0])) && ann[0]) %}
54+
VERSION = {{ `pkg-config #{pkg_config_name} --silence-errors --modversion || printf "0.0.0"`.chomp.stringify }}
5455
{% end %}
5556

5657
alias Int = LibC::Int

0 commit comments

Comments
 (0)