mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
[Build] Let AUTOMOC process library headers (#7638)
The 13 libraries using qt6_wrap_cpp(MOC_SOURCES ${HEADERS}) listed their\nheaders twice and depended on a generated source list. Add the headers to the\ntarget sources directly and delete the qt6_wrap_cpp call; AUTOMOC scans them\nand generates the same moc output.\n\nThe change exposed that server_card_counter_test never defined the rng global\nthat the server remote library references; every sibling server test does.\nGive the test the same definition so the target links.\n\nVerification: full client, Oracle, server and test build passed.
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
345b0e8ba9
commit
52d3978f84
14 changed files with 18 additions and 40 deletions
|
|
@ -21,11 +21,9 @@ set(HEADERS
|
|||
libcockatrice/card/relation/card_relation.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_card STATIC
|
||||
${MOC_SOURCES}
|
||||
${HEADERS}
|
||||
libcockatrice/card/card_info.cpp
|
||||
libcockatrice/card/card_info_comparator.cpp
|
||||
libcockatrice/card/card_localization.cpp
|
||||
|
|
|
|||
|
|
@ -18,11 +18,9 @@ set(HEADERS
|
|||
libcockatrice/deck_list/sideboard_plan.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_deck_list STATIC
|
||||
${MOC_SOURCES}
|
||||
${HEADERS}
|
||||
libcockatrice/deck_list/tree/abstract_deck_list_card_node.cpp
|
||||
libcockatrice/deck_list/tree/abstract_deck_list_node.cpp
|
||||
libcockatrice/deck_list/tree/deck_list_card_node.cpp
|
||||
|
|
|
|||
|
|
@ -6,11 +6,9 @@ set(HEADERS libcockatrice/filters/filter_card.h libcockatrice/filters/filter_str
|
|||
libcockatrice/filters/filter_tree.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_filters STATIC ${MOC_SOURCES} libcockatrice/filters/filter_card.cpp
|
||||
libcockatrice/filters/filter_string.cpp libcockatrice/filters/filter_tree.cpp
|
||||
libcockatrice_filters STATIC ${HEADERS} libcockatrice/filters/filter_card.cpp libcockatrice/filters/filter_string.cpp
|
||||
libcockatrice/filters/filter_tree.cpp
|
||||
)
|
||||
|
||||
add_dependencies(libcockatrice_filters libcockatrice_card)
|
||||
|
|
|
|||
|
|
@ -24,9 +24,7 @@ set(HEADERS
|
|||
libcockatrice/interfaces/noop_card_set_priority_controller.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(libcockatrice_interfaces STATIC ${MOC_SOURCES})
|
||||
add_library(libcockatrice_interfaces STATIC ${HEADERS})
|
||||
|
||||
target_include_directories(libcockatrice_interfaces PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
|
|
|||
|
|
@ -12,11 +12,9 @@ set(HEADERS
|
|||
token/token_edit_model.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_models_database STATIC
|
||||
${MOC_SOURCES}
|
||||
${HEADERS}
|
||||
card_database_model.cpp
|
||||
card_database_display_model.cpp
|
||||
card/card_completer_proxy_model.cpp
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ set(CMAKE_AUTORCC ON)
|
|||
|
||||
set(HEADERS deck_list_model.h deck_list_sort_filter_proxy_model.h)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_models_deck_list STATIC ${MOC_SOURCES} deck_list_model.cpp deck_list_model_custom_zones.cpp
|
||||
libcockatrice_models_deck_list STATIC ${HEADERS} deck_list_model.cpp deck_list_model_custom_zones.cpp
|
||||
deck_list_sort_filter_proxy_model.cpp
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ set(HEADERS abstract_client.h latency_tracker.h)
|
|||
|
||||
set(SOURCES abstract_client.cpp latency_tracker.cpp)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(libcockatrice_network_client_abstract STATIC ${MOC_SOURCES} ${SOURCES})
|
||||
add_library(libcockatrice_network_client_abstract STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
add_dependencies(libcockatrice_network_client_abstract libcockatrice_protocol libcockatrice_network_server_remote)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ set(HEADERS local_client.h)
|
|||
|
||||
set(SOURCES local_client.cpp)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(libcockatrice_network_client_local STATIC ${MOC_SOURCES} ${SOURCES})
|
||||
add_library(libcockatrice_network_client_local STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
add_dependencies(libcockatrice_network_client_local libcockatrice_network_client_abstract)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ set(HEADERS remote_client.h)
|
|||
|
||||
set(SOURCES remote_client.cpp)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(libcockatrice_network_client_remote STATIC ${MOC_SOURCES} ${SOURCES})
|
||||
add_library(libcockatrice_network_client_remote STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
add_dependencies(libcockatrice_network_client_remote libcockatrice_network_client_abstract libcockatrice_protocol)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ set(HEADERS local_server.h local_server_interface.h)
|
|||
|
||||
set(SOURCES local_server.cpp local_server_interface.cpp)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(libcockatrice_network_server_local STATIC ${MOC_SOURCES} ${SOURCES})
|
||||
add_library(libcockatrice_network_server_local STATIC ${HEADERS} ${SOURCES})
|
||||
|
||||
add_dependencies(libcockatrice_network_server_local libcockatrice_protocol)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,9 @@ set(HEADERS
|
|||
serverinfo_user_container.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_network_server_remote STATIC
|
||||
${MOC_SOURCES}
|
||||
${HEADERS}
|
||||
game/dump_zone_range.cpp
|
||||
game/server_abstract_participant.cpp
|
||||
game/server_abstract_player.cpp
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ set(CMAKE_AUTORCC ON)
|
|||
|
||||
set(HEADERS libcockatrice/rng/rng_abstract.h libcockatrice/rng/rng_sfmt.h libcockatrice/rng/sfmt/SFMT.h)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_rng STATIC ${MOC_SOURCES} libcockatrice/rng/rng_abstract.cpp libcockatrice/rng/rng_sfmt.cpp
|
||||
libcockatrice_rng STATIC ${HEADERS} libcockatrice/rng/rng_abstract.cpp libcockatrice/rng/rng_sfmt.cpp
|
||||
libcockatrice/rng/sfmt/SFMT.c
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,9 @@ set(HEADERS
|
|||
libcockatrice/settings/visual_deck_storage_settings.h
|
||||
)
|
||||
|
||||
qt6_wrap_cpp(MOC_SOURCES ${HEADERS})
|
||||
|
||||
add_library(
|
||||
libcockatrice_settings STATIC
|
||||
${MOC_SOURCES}
|
||||
${HEADERS}
|
||||
libcockatrice/settings/appearance_settings.cpp
|
||||
libcockatrice/settings/cache_storage_settings.cpp
|
||||
libcockatrice/settings/card_database_settings.cpp
|
||||
|
|
|
|||
|
|
@ -8,10 +8,14 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <libcockatrice/network/server/remote/game/server_card.h>
|
||||
#include <libcockatrice/protocol/pb/event_set_card_counter.pb.h>
|
||||
#include <libcockatrice/rng/rng_abstract.h>
|
||||
#include <libcockatrice/utility/card_ref.h>
|
||||
#include <libcockatrice/utility/counter_limits.h>
|
||||
#include <string>
|
||||
|
||||
// Referenced by other translation units in the server_remote library.
|
||||
RNG_Abstract *rng = nullptr;
|
||||
|
||||
TEST(ServerCardCounter, IncrementNewCounter)
|
||||
{
|
||||
Server_Card card(CardRef{"TestCard", ""}, 1, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue