diff --git a/.github/workflows/ci-cell.yml b/.github/workflows/ci-cell.yml index be6b8846..0aea2583 100644 --- a/.github/workflows/ci-cell.yml +++ b/.github/workflows/ci-cell.yml @@ -23,6 +23,10 @@ on: required: false type: boolean default: false + with-atl: + required: false + type: boolean + default: false with-mfc: required: false type: boolean @@ -70,6 +74,7 @@ jobs: if [ "${{ inputs.c-compiler }}" = "cl" ]; then cmake -S "$STLSRC" -B "$STLINSTALL" \ + -DCMAKE_DISABLE_FIND_PACKAGE_ATL=TRUE \ -DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE \ -DCMAKE_INSTALL_PREFIX="$DEPS" \ -DBUILD_EXAMPLES=OFF \ @@ -104,6 +109,7 @@ jobs: if [ "${{ inputs.c-compiler }}" = "cl" ]; then cmake -S "$XTSRC" -B "$XTBUILD" \ + -DCMAKE_DISABLE_FIND_PACKAGE_ATL=TRUE \ -DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE \ -DCMAKE_INSTALL_PREFIX="$DEPS" \ -DCMAKE_PREFIX_PATH="$DEPS" \ @@ -149,8 +155,14 @@ jobs: else ACE_FLAG="-DNO_ACE=ON" fi - # Default MSVC cells suppress MFC discovery (keeps non-MFC cells lean). - # **with-mfc** cells leave FindMFC enabled so **MFCSTL** tests build. + # Default MSVC cells suppress ATL/MFC discovery (keeps lean cells lean). + # **with-atl** / **with-mfc** leave the matching find enabled so + # **ATLSTL** / **MFCSTL** can build (versions smoke; mfcstl tests). + if [ "${{ inputs.c-compiler }}" = "cl" ] && [ "${{ inputs.with-atl }}" != "true" ]; then + ATL_FLAG="-DCMAKE_DISABLE_FIND_PACKAGE_ATL=TRUE" + else + ATL_FLAG="" + fi if [ "${{ inputs.c-compiler }}" = "cl" ] && [ "${{ inputs.with-mfc }}" != "true" ]; then MFC_FLAG="-DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE" else @@ -158,6 +170,7 @@ jobs: fi if [ "${{ inputs.c-compiler }}" = "cl" ]; then cmake -B build -S . \ + $ATL_FLAG \ $MFC_FLAG \ -DCMAKE_PREFIX_PATH="${RUNNER_TEMP}/sis-deps" \ -DBUILD_EXAMPLES=ON \ @@ -207,6 +220,21 @@ jobs: echo "ACE_LIBRARY=${ACE_LIB}" echo "ACE_INCLUDE_DIR=${ACE_INC}" + - name: Verify ATL discovered + if: inputs.with-atl + shell: bash + run: | + set -euo pipefail + ATL_HAVE="$(grep -E '^ATL_HAVE_ATL:(BOOL|INTERNAL)=' build/CMakeCache.txt | head -1 | cut -d= -f2- || true)" + ATL_FOUND="$(grep -E '^ATL_FOUND:(BOOL|INTERNAL|STRING)=' build/CMakeCache.txt | head -1 | cut -d= -f2- || true)" + if [ "${ATL_HAVE}" != "1" ] && [ "${ATL_HAVE}" != "TRUE" ] && [ "${ATL_HAVE}" != "ON" ] && [ "${ATL_FOUND}" != "YES" ] && [ "${ATL_FOUND}" != "TRUE" ] && [ "${ATL_FOUND}" != "ON" ]; then + echo "with-atl requested but ATL was not found:" >&2 + grep -i '^ATL_' build/CMakeCache.txt || true + exit 1 + fi + echo "ATL_HAVE_ATL=${ATL_HAVE}" + echo "ATL_FOUND=${ATL_FOUND}" + - name: Verify MFC discovered if: inputs.with-mfc shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75493e90..666e8100 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,7 @@ jobs: cpp-compiler: ${{ matrix.cpp_compiler }} build-type: Release with-ace: false + with-atl: false with-mfc: false secrets: inherit @@ -84,6 +85,29 @@ jobs: cpp-compiler: ${{ matrix.cpp_compiler }} build-type: Release with-ace: true + with-atl: false + with-mfc: false + secrets: inherit + + cell-atl: + name: CI ATL (${{ matrix.id }}) + strategy: + fail-fast: false + matrix: + include: + - id: windows-cl-atl + os: windows-latest + c_compiler: cl + cpp_compiler: cl + uses: ./.github/workflows/ci-cell.yml + with: + cell-id: ${{ matrix.id }} + os: ${{ matrix.os }} + c-compiler: ${{ matrix.c_compiler }} + cpp-compiler: ${{ matrix.cpp_compiler }} + build-type: Release + with-ace: false + with-atl: true with-mfc: false secrets: inherit @@ -105,6 +129,7 @@ jobs: cpp-compiler: ${{ matrix.cpp_compiler }} build-type: Release with-ace: false + with-atl: false with-mfc: true secrets: inherit @@ -155,6 +180,7 @@ jobs: set -euo pipefail if [ "${{ matrix.c_compiler }}" = "cl" ]; then cmake -B build -S . \ + -DCMAKE_DISABLE_FIND_PACKAGE_ATL=TRUE \ -DCMAKE_DISABLE_FIND_PACKAGE_MFC=TRUE \ -DBUILD_EXAMPLES=OFF \ -DBUILD_TESTING=OFF diff --git a/CMakeLists.txt b/CMakeLists.txt index a79785a4..02f1f520 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,9 +95,17 @@ endif(MSVC) if(WIN32) + find_package(ATL QUIET) find_package(MFC QUIET) endif(WIN32) +if(ATL_FOUND) + + message("-- using Active Template Library") + + add_compile_definitions(STLSOFT_HAS_ATL) +endif(ATL_FOUND) + if(MFC_FOUND) # Shared MFC (/MD + _AFXDLL) unless the project is configured for the diff --git a/TODO.md b/TODO.md index 0d8affee..4a40c9fe 100644 --- a/TODO.md +++ b/TODO.md @@ -27,10 +27,12 @@ ### 1.11.1 -* [ ] Remove **WTL**; * [x] ~~~ACESTL: implement `invoke_ACE_OS_snprintf` in terms of `stlsoft_C_snprintf()`~~~ - ✅; +* [x] ~~~CI: exercise **ATLSTL** on a Windows cell~~~ - ✅; * [x] ~~~CI: exercise **MFCSTL** on a Windows cell (drop / gate `CMAKE_DISABLE_FIND_PACKAGE_MFC`; confirm MSVC+MFC on the runner)~~~ - ✅; +* [ ] Remove **WTL**; * [ ] Resolve finally the structure and semantics of the top-level execution scripts (**run_all_unit_tests.sh**, **run_all_scratch_tests.sh**, **run_all_examples.sh**, **execute_performance_tests.sh**, and Windows `.cmd` counterparts) on all platforms — discovery globs, execute-bit / artifact restore, zero-match failure, verbosity, and CI wiring; +* [ ] bring in some essential unit-tests from interal repo; ### 1.11.2 diff --git a/cmake/FindATL.cmake b/cmake/FindATL.cmake new file mode 100644 index 00000000..2c1e71f9 --- /dev/null +++ b/cmake/FindATL.cmake @@ -0,0 +1,36 @@ +# FindATL.cmake +# +# Detects Microsoft Active Template Library (ATL) headers for MSVC on +# Windows (not MinGW / Borland). +# +# Sets: +# ATL_FOUND +# ATL_HAVE_ATL (CACHE; true when atlbase.h is usable) +# +# There is no stock CMake FindATL; this mirrors FindMFC's Windows-only +# check. ATL is typically header-available with the VC ATL component and +# needs no extra link flags for compile-only / version smoke use. + + +set(ATL_FOUND FALSE) + +# Only attempt when the toolset has a chance of shipping atlbase.h: +if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW) + + if(NOT DEFINED ATL_HAVE_ATL) + + include(CheckIncludeFileCXX) + + check_include_file_cxx("atlbase.h" ATL_HAVE_ATL) + endif() + + if(ATL_HAVE_ATL) + + set(ATL_FOUND TRUE) + endif() +endif() + +mark_as_advanced(ATL_HAVE_ATL) + + +# ############################## end of file ############################# # diff --git a/test/unit/test.unit.versions/entry.cpp b/test/unit/test.unit.versions/entry.cpp index 4b43cf80..a5d68981 100644 --- a/test/unit/test.unit.versions/entry.cpp +++ b/test/unit/test.unit.versions/entry.cpp @@ -31,6 +31,9 @@ #ifdef STLSOFT_HAS_ACE # include #endif +#ifdef STLSOFT_HAS_ATL +# include +#endif #ifdef STLSOFT_HAS_MFC # include #endif @@ -58,6 +61,9 @@ namespace { static void TEST__STLSOFT_VER(); #ifdef STLSOFT_HAS_ACE static void TEST__ACESTL_VER(); +#endif +#ifdef STLSOFT_HAS_ATL + static void TEST__ATLSTL_VER(); #endif static void TEST__PLATFORMSTL_VER(); #if 0 @@ -91,6 +97,9 @@ int main(int argc, char **argv) XTESTS_RUN_CASE(TEST__STLSOFT_VER); #ifdef STLSOFT_HAS_ACE XTESTS_RUN_CASE(TEST__ACESTL_VER); +#endif +#ifdef STLSOFT_HAS_ATL + XTESTS_RUN_CASE(TEST__ATLSTL_VER); #endif XTESTS_RUN_CASE(TEST__PLATFORMSTL_VER); #if 0 @@ -132,6 +141,13 @@ static void TEST__ACESTL_VER() TEST_INT_EQ(_ACESTL_VER_1_2_1, _ACESTL_VER); } #endif +#ifdef STLSOFT_HAS_ATL + +static void TEST__ATLSTL_VER() +{ + TEST_INT_EQ(_ATLSTL_VER_1_7_1, _ATLSTL_VER); +} +#endif static void TEST__PLATFORMSTL_VER() {