Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests with multi-config build generators #2098

Merged
merged 2 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
libsdl2-mixer-dev
- name: Configure
run: |
cmake . -B build -G Ninja --preset "DistroRelease"
cmake . -B build -G "Ninja Multi-Config" --preset "DistroRelease"
- name: Build
run: |
cmake --build build
Expand Down
4 changes: 2 additions & 2 deletions data/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ endif()
# Create the test file. This is ugly because we need to replace variables
# and use generator expressions.
configure_file(rulesets.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp.in)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/rulesets.cpp
INPUT ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp.in)

add_executable(test_rulesets ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp)
add_executable(test_rulesets ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/rulesets.cpp)
target_link_libraries(test_rulesets PRIVATE Qt5::Test)
add_test(NAME test_rulesets
COMMAND test_rulesets
Expand Down
4 changes: 2 additions & 2 deletions server/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ set(CMAKE_AUTOMOC ON)
# Create the test file. This is ugly because we need to replace variables
# and use generator expressions.
configure_file(cli.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp.in)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/cli.cpp
INPUT ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp.in)

add_executable(test_server_cli ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp)
add_executable(test_server_cli ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/cli.cpp)
target_link_libraries(test_server_cli PRIVATE Qt5::Test)
add_test(NAME test_server_cli
COMMAND test_server_cli
Expand Down
Loading