diff --git a/CMakeLists.txt b/CMakeLists.txt index c451616..4dd7596 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,11 +63,19 @@ else() if(NOT TARGET SDL3_ttf::SDL3_ttf) find_package(SDL3_ttf REQUIRED) endif() + # No version here: libakerror ships no akerrorConfigVersion.cmake, so asking + # for one makes find_package reject every install. The floor is enforced by + # the #error in include/akgl/error.h instead, which feature-tests + # AKERR_FIRST_CONSUMER_STATUS. if(NOT TARGET akerror::akerror) find_package(akerror REQUIRED) endif() + # 0.1 rather than bare: libakstdlib 0.1.0 ships an akstdlibConfigVersion.cmake + # with SameMinorVersion compatibility, mirroring its soname, so this accepts + # any 0.1.x and refuses 0.2 and 1.0. Unversioned, this path would silently + # accept an ABI-incompatible libakstdlib. if(NOT TARGET akstdlib::akstdlib) - find_package(akstdlib REQUIRED) + find_package(akstdlib 0.1 REQUIRED) endif() if(NOT TARGET jansson::jansson) find_package(jansson) @@ -140,10 +148,10 @@ set_target_properties(akgl PROPERTIES add_library(akgl::akgl ALIAS akgl) add_executable(charviewer util/charviewer.c) -add_executable(test_semver_unit deps/semver/semver_unit.c) +add_executable(akgl_test_semver_unit deps/semver/semver_unit.c) # Every suite here is a standalone C program named tests/.c, built as -# test_ and registered with CTest under . +# akgl_test_ and registered with CTest under . set(AKGL_TEST_SUITES actor bitmasks @@ -162,12 +170,16 @@ set(AKGL_TEST_SUITES version ) +# The executables carry an akgl_ prefix but the CTest names do not: a vendored +# dependency is free to ship its own tests/version.c, and libakstdlib now does. +# Its target is created by add_subdirectory even though EXCLUDE_FROM_ALL keeps +# it from being built, so an unprefixed test_version here is a configure error. foreach(suite IN LISTS AKGL_TEST_SUITES) - add_executable(test_${suite} tests/${suite}.c) - add_test(NAME ${suite} COMMAND test_${suite}) + add_executable(akgl_test_${suite} tests/${suite}.c) + add_test(NAME ${suite} COMMAND akgl_test_${suite}) endforeach() -add_test(NAME semver_unit COMMAND test_semver_unit) +add_test(NAME semver_unit COMMAND akgl_test_semver_unit) set_tests_properties( ${AKGL_TEST_SUITES} semver_unit @@ -235,8 +247,8 @@ target_link_libraries(akgl ) foreach(suite IN LISTS AKGL_TEST_SUITES) - target_link_libraries(test_${suite} PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) - target_include_directories(test_${suite} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/tests") + target_link_libraries(akgl_test_${suite} PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) + target_include_directories(akgl_test_${suite} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/tests") endforeach() target_link_libraries(charviewer PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) @@ -256,7 +268,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) "$" ) foreach(suite IN LISTS AKGL_TEST_SUITES) - set_target_properties(test_${suite} PROPERTIES BUILD_RPATH "${AKGL_VENDORED_RPATH}") + set_target_properties(akgl_test_${suite} PROPERTIES BUILD_RPATH "${AKGL_VENDORED_RPATH}") endforeach() set_target_properties(charviewer akgl PROPERTIES BUILD_RPATH "${AKGL_VENDORED_RPATH}") diff --git a/deps/libakstdlib b/deps/libakstdlib index a87cbfb..95e5002 160000 --- a/deps/libakstdlib +++ b/deps/libakstdlib @@ -1 +1 @@ -Subproject commit a87cbfb26dce716e263c918908b2039741ff1aff +Subproject commit 95e500251260e2ce5984226aa12079969bffd873