summary refs log tree commit diff stats
path: root/tests/compiler/tcmdlineclib.nims
diff options
context:
space:
mode:
authorTomohiro <gpuppur@gmail.com>2022-09-02 02:57:17 +0900
committerGitHub <noreply@github.com>2022-09-01 13:57:17 -0400
commit2a34d143ac408df0e3716fbbf53dcca490ef9d49 (patch)
treed5f79bccb1916431c963990f68e9a8c83d723f9c /tests/compiler/tcmdlineclib.nims
parenta95b6391fd353074daf2dbfed4d73e8d57f314ca (diff)
downloadNim-2a34d143ac408df0e3716fbbf53dcca490ef9d49.tar.gz
Fix #16937; --clib option pass library name to backend C compiler correctly (#19754)
* Fix 16937: Make --clib option works

* Make tests/compiler/tcmdlineclib.nim works from any current dir

* Try to fix link error on macosx

* Add a comment to tests/compiler/tcmdlineclib.nims

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
Diffstat (limited to 'tests/compiler/tcmdlineclib.nims')
-rw-r--r--tests/compiler/tcmdlineclib.nims10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/compiler/tcmdlineclib.nims b/tests/compiler/tcmdlineclib.nims
new file mode 100644
index 000000000..f7899d92e
--- /dev/null
+++ b/tests/compiler/tcmdlineclib.nims
@@ -0,0 +1,10 @@
+import os
+
+selfExec "c --app:lib " & (projectDir() / "samplelib.nim")
+switch("clibdir", projectDir())
+--clib:samplelib
+
+# Make test executable can load sample shared library.
+# `-rpath` option doesn't work and ignored on Windows.
+# But the dll file in same directory as executable file is loaded.
+switch("passL", "-Wl,-rpath," & projectDir())