Skip to content
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
32 changes: 30 additions & 2 deletions .github/workflows/ci-cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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" \
Expand Down Expand Up @@ -149,15 +155,22 @@ 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
MFC_FLAG=""
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 \
Expand Down Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
cpp-compiler: ${{ matrix.cpp_compiler }}
build-type: Release
with-ace: false
with-atl: false
with-mfc: false
secrets: inherit

Expand All @@ -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

Expand All @@ -105,6 +129,7 @@ jobs:
cpp-compiler: ${{ matrix.cpp_compiler }}
build-type: Release
with-ace: false
with-atl: false
with-mfc: true
secrets: inherit

Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions cmake/FindATL.cmake
Original file line number Diff line number Diff line change
@@ -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 ############################# #
16 changes: 16 additions & 0 deletions test/unit/test.unit.versions/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
#ifdef STLSOFT_HAS_ACE
# include <acestl/acestl.hpp>
#endif
#ifdef STLSOFT_HAS_ATL
# include <atlstl/atlstl.hpp>
#endif
#ifdef STLSOFT_HAS_MFC
# include <mfcstl/mfcstl.hpp>
#endif
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
{
Expand Down
Loading