summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-05-17 15:26:00 +0200
committerEgor Tensin <egor@tensin.name>2026-05-17 17:47:32 +0200
commit06c39b2fc4438b96338568cae82b44726abd7144 (patch)
tree087d1cb7bc8295348b52bd7fe08b8d2599802786
parentcmake: use CONFIGURE_DEPENDS (diff)
downloadwinapi-common-06c39b2fc4438b96338568cae82b44726abd7144.tar.gz
winapi-common-06c39b2fc4438b96338568cae82b44726abd7144.zip
upgrade cmake-common
* common.cmake is removed. * PDB installation is done in an arguably simpler, custom way. * winapi-utf8 is upgraded.
-rw-r--r--.github/workflows/ci.yml5
m---------3rdparty/winapi/utf80
-rw-r--r--CMakeLists.txt12
-rw-r--r--Makefile8
m---------cmake0
-rw-r--r--test/CMakeLists.txt4
-rw-r--r--test/unit_tests/CMakeLists.txt9
7 files changed, 26 insertions, 12 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ae1a9e7..e9a2b66 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,6 +19,7 @@ jobs:
build:
strategy:
+ fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022, windows-2025]
platform: [x64, x86]
@@ -41,7 +42,7 @@ jobs:
PLATFORM: '${{ matrix.platform }}'
CONFIGURATION: '${{ matrix.configuration }}'
BOOST_VERSION: '${{ matrix.boost-version }}'
- CMAKE_FLAGS: -D WINAPI_COMMON_TESTS=ON
+ CMAKE_FLAGS: --cmake-arg=-DWINAPI_COMMON_TESTS=ON
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -92,7 +93,7 @@ jobs:
env:
TOOLSET: mingw
BOOST_VERSION: 1.81.0
- CMAKE_FLAGS: -D WINAPI_COMMON_TESTS=OFF
+ CMAKE_FLAGS: --cmake-arg=-DWINAPI_COMMON_TESTS=OFF
steps:
# This is rather stupid. In order to build Doxygen docs, I need a working
# CMake build directory, so I assume that means I need to pretty much
diff --git a/3rdparty/winapi/utf8 b/3rdparty/winapi/utf8
-Subproject 751dd9debb3583020fe7be3688b81e4e9a7503c
+Subproject fe229e10eb2fe772e464665fb59e7bd82a684d1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b11c22..428bd88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,16 @@
-# For CONFIGURE_DEPENDS
-cmake_minimum_required(VERSION 3.12)
+# oldstable as of May '26
+cmake_minimum_required(VERSION 3.25)
project(winapi_common CXX)
enable_testing()
-include(cmake/common.cmake)
+if (MSVC)
+ add_compile_options(/MP /W4)
+else()
+ add_compile_options(-Wall -Wextra)
+endif()
+
+add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX)
find_package(Boost REQUIRED)
add_subdirectory(3rdparty/winapi/utf8 EXCLUDE_FROM_ALL)
diff --git a/Makefile b/Makefile
index 4a16970..d1c8fcd 100644
--- a/Makefile
+++ b/Makefile
@@ -11,8 +11,8 @@ TOOLSET ?= mingw
PLATFORM ?= auto
CONFIGURATION ?= Debug
BOOST_VERSION ?= 1.81.0
-BOOST_LIBRARIES := --with-test
-CMAKE_FLAGS ?= -D WINAPI_COMMON_TESTS=ON
+BOOST_LIBRARIES := test
+CMAKE_FLAGS ?= --cmake-arg=-DWINAPI_COMMON_TESTS=ON
INSTALL_PREFIX ?= $(install_dir)
$(eval $(call noexpand,TOOLSET))
@@ -54,10 +54,10 @@ build:
--configuration '$(call escape,$(CONFIGURATION))' \
--install '$(call escape,$(INSTALL_PREFIX))' \
--boost '$(call escape,$(boost_dir))' \
+ $(CMAKE_FLAGS) \
-- \
'$(call escape,$(src_dir))' \
- '$(call escape,$(cmake_dir))' \
- $(CMAKE_FLAGS)
+ '$(call escape,$(cmake_dir))'
.PHONY: install
install: build
diff --git a/cmake b/cmake
-Subproject 9e7304af2fe5a4f89da64ac76768697aac4f858
+Subproject 899a49f46c62aaebdc2f0988496c493f0963248
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 396356d..4d930a9 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,7 +1,9 @@
add_executable(echo echo.cpp)
set_target_properties(echo PROPERTIES OUTPUT_NAME winapi-common-test-echo)
install(TARGETS echo RUNTIME DESTINATION bin)
-install_pdbs(TARGETS echo DESTINATION bin)
+if(MSVC)
+ install(FILES $<TARGET_PDB_FILE:echo> DESTINATION bin OPTIONAL)
+endif()
if(MINGW)
target_compile_options(echo PRIVATE -municode)
target_link_libraries(echo PRIVATE -municode)
diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt
index b8c8c7c..d993b3b 100644
--- a/test/unit_tests/CMakeLists.txt
+++ b/test/unit_tests/CMakeLists.txt
@@ -8,7 +8,6 @@ set_target_properties(unit_tests PROPERTIES OUTPUT_NAME winapi-common-unit-tests
target_link_libraries(unit_tests PRIVATE winapi_common winapi_utf8)
target_link_libraries(unit_tests PRIVATE Boost::disable_autolinking Boost::unit_test_framework)
install(TARGETS unit_tests RUNTIME DESTINATION bin)
-install_pdbs(TARGETS unit_tests DESTINATION bin)
file(GLOB worker_src CONFIGURE_DEPENDS "worker/*.cpp")
add_executable(worker ${worker_src} ${shared_src})
@@ -16,7 +15,13 @@ set_target_properties(worker PROPERTIES OUTPUT_NAME winapi-common-test-worker)
target_link_libraries(worker PRIVATE winapi_common winapi_utf8)
target_link_libraries(worker PRIVATE Boost::disable_autolinking Boost::boost)
install(TARGETS worker RUNTIME DESTINATION bin)
-install_pdbs(TARGETS worker DESTINATION bin)
+
+if(MSVC)
+ install(FILES
+ $<TARGET_PDB_FILE:unit_tests>
+ $<TARGET_PDB_FILE:worker>
+ DESTINATION bin OPTIONAL)
+endif()
find_package(Python3 REQUIRED COMPONENTS Interpreter)