Skip to content

Commit ac86480

Browse files
Test that the linker can also see the extra_srcs.
1 parent 680e875 commit ac86480

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

tests/extra-source-files/BUILD

+23
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package(default_testonly = 1)
22

33
load(
44
"@io_tweag_rules_haskell//haskell:haskell.bzl",
5+
"haskell_binary",
56
"haskell_library",
67
)
78

@@ -11,8 +12,30 @@ haskell_library(
1112
"Foo.hs",
1213
"FooTH.hs",
1314
],
15+
# Test that the linker can also see the extra_srcs.
16+
compiler_flags = ["-optl-Wl,@tests/extra-source-files/ld-options.txt"],
1417
extra_srcs = [
1518
"file.txt",
19+
"ld-options.txt",
20+
],
21+
prebuilt_dependencies = [
22+
"base",
23+
"template-haskell",
24+
],
25+
)
26+
27+
haskell_binary(
28+
name = "extra-source-files-bin",
29+
srcs = [
30+
"FooTH.hs",
31+
"Foo.hs",
32+
"Main.hs",
33+
],
34+
# Test that the linker can also see the extra_srcs.
35+
compiler_flags = ["-optl-Wl,@tests/extra-source-files/ld-options.txt"],
36+
extra_srcs = [
37+
"file.txt",
38+
"ld-options.txt",
1639
],
1740
prebuilt_dependencies = [
1841
"base",

tests/extra-source-files/Main.hs

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Foo (foo)
2+
3+
main :: IO ()
4+
main = putStrLn foo

tests/extra-source-files/ld-options.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)