test(relative-paths): Make `link-libraries` conditional to the Windows platform

main
Anthony Printup 8 months ago
parent 854e8817c4
commit b24a0a2fdc
No known key found for this signature in database
GPG Key ID: C8CB17EEA5183BD0

29
tests/CMakeLists.txt generated

@ -110,22 +110,15 @@ add_test(
build build
) )
add_test( if(WIN32) # windows
NAME add_test(
relative-paths-setup NAME
WORKING_DIRECTORY relative-paths
"${CMAKE_CURRENT_LIST_DIR}/relative-paths" WORKING_DIRECTORY
COMMAND "${CMAKE_CURRENT_LIST_DIR}/relative-paths"
"$<TARGET_FILE:cmkr>" COMMAND
"build --target test-library" "$<TARGET_FILE:cmkr>"
) build
)
add_test( endif()
NAME
relative-paths
WORKING_DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/relative-paths"
COMMAND
"$<TARGET_FILE:cmkr>"
"build --target example"
)

@ -60,13 +60,8 @@ command = "$<TARGET_FILE:cmkr>"
arguments = ["build"] arguments = ["build"]
[[test]] [[test]]
name = "relative-paths-setup" condition = "windows"
working-directory = "relative-paths"
command = "$<TARGET_FILE:cmkr>"
arguments = ["build --target test-library"]
[[test]]
name = "relative-paths" name = "relative-paths"
working-directory = "relative-paths" working-directory = "relative-paths"
command = "$<TARGET_FILE:cmkr>" command = "$<TARGET_FILE:cmkr>"
arguments = ["build --target example"] arguments = ["build"]

@ -8,4 +8,4 @@ sources = ["src/library-code.cpp"]
[target.example] [target.example]
type = "executable" type = "executable"
sources = ["src/main.cpp"] sources = ["src/main.cpp"]
link-libraries = ["libs/test-library-file.lib"] windows.link-libraries = ["libs/test-library-x64-Release.lib"]

@ -1,8 +1,12 @@
// Created by Anthony Printup on 9/18/2023. // Created by Anthony Printup on 9/18/2023.
#include <cstdio> #include <cstdio>
#ifdef WIN32
extern "C" void library_function(); extern "C" void library_function();
#endif
int main() { int main() {
puts("Hello from cmkr(relative-paths)!"); puts("Hello from cmkr(relative-paths)!");
#ifdef WIN32
library_function(); library_function();
#endif
} }

Loading…
Cancel
Save