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

main
Anthony Printup 7 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
)
add_test(
NAME
relative-paths-setup
WORKING_DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/relative-paths"
COMMAND
"$<TARGET_FILE:cmkr>"
"build --target test-library"
)
if(WIN32) # windows
add_test(
NAME
relative-paths
WORKING_DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/relative-paths"
COMMAND
"$<TARGET_FILE:cmkr>"
build
)
add_test(
NAME
relative-paths
WORKING_DIRECTORY
"${CMAKE_CURRENT_LIST_DIR}/relative-paths"
COMMAND
"$<TARGET_FILE:cmkr>"
"build --target example"
)
endif()

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

@ -8,4 +8,4 @@ sources = ["src/library-code.cpp"]
[target.example]
type = "executable"
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.
#include <cstdio>
#ifdef WIN32
extern "C" void library_function();
#endif
int main() {
puts("Hello from cmkr(relative-paths)!");
#ifdef WIN32
library_function();
#endif
}

Loading…
Cancel
Save