mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 20:43:54 -07:00
- Add addClamped() in new header clamped_arithmetic.h; uses a 64-bit intermediate so the addition cannot overflow int. - Use it in Server_Card::incrementCounter() (clamps [0, MAX_COUNTERS_ON_CARD]) and Server_Counter::incrementCount() (clamps [INT_MIN, INT_MAX]), removing the duplicated overflow-safe logic and its keep-in-sync TODO. - Inline incrementCount() into server_counter.h; server_counter.cpp now holds only the constructor and getInfo(). - Clarify the card-counter bounds comment in trice_limits.h.
32 lines
1.1 KiB
CMake
32 lines
1.1 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(Utility VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
set(CMAKE_AUTOUIC ON)
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
set(UTILITY_SOURCES libcockatrice/utility/expression.cpp libcockatrice/utility/levenshtein.cpp
|
|
libcockatrice/utility/passwordhasher.cpp
|
|
)
|
|
|
|
set(UTILITY_HEADERS
|
|
libcockatrice/utility/color.h
|
|
libcockatrice/utility/expression.h
|
|
libcockatrice/utility/levenshtein.h
|
|
libcockatrice/utility/macros.h
|
|
libcockatrice/utility/passwordhasher.h
|
|
libcockatrice/utility/trice_limits.h
|
|
libcockatrice/utility/clamped_arithmetic.h
|
|
libcockatrice/utility/zone_names.h
|
|
libcockatrice/utility/days_years_between.h
|
|
)
|
|
|
|
add_library(libcockatrice_utility STATIC ${UTILITY_SOURCES} ${UTILITY_HEADERS})
|
|
|
|
target_include_directories(libcockatrice_utility PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
target_link_libraries(libcockatrice_utility PUBLIC libcockatrice_rng ${QT_CORE_MODULE})
|
|
|
|
set(ORACLE_LIBS)
|
|
|
|
include_directories(${${COCKATRICE_QT_VERSION_NAME}Core_INCLUDE_DIRS})
|