Skip to content

Commit b24a0a2

Browse files
test(relative-paths): Make link-libraries conditional to the Windows platform
1 parent 854e881 commit b24a0a2

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed

tests/CMakeLists.txt

Lines changed: 11 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/cmake.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,8 @@ command = "$<TARGET_FILE:cmkr>"
6060
arguments = ["build"]
6161

6262
[[test]]
63-
name = "relative-paths-setup"
64-
working-directory = "relative-paths"
65-
command = "$<TARGET_FILE:cmkr>"
66-
arguments = ["build --target test-library"]
67-
68-
[[test]]
63+
condition = "windows"
6964
name = "relative-paths"
7065
working-directory = "relative-paths"
7166
command = "$<TARGET_FILE:cmkr>"
72-
arguments = ["build --target example"]
67+
arguments = ["build"]

tests/relative-paths/cmake.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ sources = ["src/library-code.cpp"]
88
[target.example]
99
type = "executable"
1010
sources = ["src/main.cpp"]
11-
link-libraries = ["libs/test-library-file.lib"]
11+
windows.link-libraries = ["libs/test-library-x64-Release.lib"]

tests/relative-paths/src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
// Created by Anthony Printup on 9/18/2023.
22
#include <cstdio>
33

4+
#ifdef WIN32
45
extern "C" void library_function();
6+
#endif
57
int main() {
68
puts("Hello from cmkr(relative-paths)!");
9+
#ifdef WIN32
710
library_function();
11+
#endif
812
}

0 commit comments

Comments
 (0)