diff options
| m--------- | 3rdparty/winapi/common | 0 | ||||
| -rw-r--r-- | CMakeLists.txt | 15 | ||||
| -rw-r--r-- | Makefile | 6 | ||||
| m--------- | cmake | 0 | ||||
| -rw-r--r-- | test/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | test/unit_tests/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | utils/CMakeLists.txt | 4 |
7 files changed, 27 insertions, 10 deletions
diff --git a/3rdparty/winapi/common b/3rdparty/winapi/common -Subproject d40a5944241178f29ac4753604ef89c39377384 +Subproject c4b37a997014609f7c32b9eae73981806026653 diff --git a/CMakeLists.txt b/CMakeLists.txt index 20b6a16..91011e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,19 @@ -cmake_minimum_required(VERSION 3.8) +# oldstable as of May '26 +# Plus, I'm pretty sure it's required for things like CONFIGURE_DEPENDS and +# CMAKE_MSVC_RUNTIME_LIBRARY and stuff. +cmake_minimum_required(VERSION 3.25) project(winapi_debug CXX) enable_testing() +if (MSVC) + add_compile_options(/MP /W4) +else() + add_compile_options(-Wall -Wextra) +endif() + +add_compile_definitions(WIN32_LEAN_AND_MEAN NOMINMAX) + if(MSVC) # This is an ugly hack to make the tests work. # With incremental linking, the &func address does not point to the @@ -24,8 +35,6 @@ if(MSVC) "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}") endif() -include(cmake/common.cmake) - find_package(Boost REQUIRED) add_subdirectory(3rdparty/winapi/common EXCLUDE_FROM_ALL) @@ -11,7 +11,7 @@ TOOLSET ?= mingw PLATFORM ?= auto CONFIGURATION ?= Debug BOOST_VERSION ?= 1.81.0 -BOOST_LIBRARIES := --with-filesystem --with-program_options --with-test +BOOST_LIBRARIES := filesystem program_options test CMAKE_FLAGS ?= INSTALL_PREFIX ?= $(install_dir) @@ -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 17770c9..b77003c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,12 +3,16 @@ target_link_libraries(test_lib PRIVATE winapi_debug) target_include_directories(test_lib PUBLIC .) target_compile_definitions(test_lib PRIVATE TEST_LIB_EXPORTS) install(TARGETS test_lib RUNTIME DESTINATION bin/test) -install_pdbs(TARGETS test_lib DESTINATION bin/test) +if(MSVC) + install(FILES $<TARGET_PDB_FILE:test_lib> DESTINATION bin/test OPTIONAL) +endif() add_executable(call_stack call_stack.cpp) target_link_libraries(call_stack PRIVATE test_lib) install(TARGETS call_stack RUNTIME DESTINATION bin/test) -install_pdbs(TARGETS call_stack DESTINATION bin/test) +if(MSVC) + install(FILES $<TARGET_PDB_FILE:call_stack> DESTINATION bin/test OPTIONAL) +endif() find_package(Python3 REQUIRED COMPONENTS Interpreter) diff --git a/test/unit_tests/CMakeLists.txt b/test/unit_tests/CMakeLists.txt index 93b7b8b..958eb92 100644 --- a/test/unit_tests/CMakeLists.txt +++ b/test/unit_tests/CMakeLists.txt @@ -7,7 +7,9 @@ target_link_libraries(unit_tests PRIVATE Boost::filesystem Boost::unit_test_framework) install(TARGETS unit_tests RUNTIME DESTINATION bin/test) -install_pdbs(TARGETS unit_tests DESTINATION bin/test) +if(MSVC) + install(FILES $<TARGET_PDB_FILE:unit_tests> DESTINATION bin/test OPTIONAL) +endif() if(MSVC) # Set the working directory so that the unit_tests binary can find the diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 3b7f865..62ca7fd 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -5,7 +5,9 @@ function(add_util name src) target_link_libraries("${name}" PRIVATE winapi_debug) target_link_libraries("${name}" PRIVATE Boost::disable_autolinking Boost::filesystem Boost::program_options) install(TARGETS "${name}" RUNTIME DESTINATION bin) - install_pdbs(TARGETS "${name}" DESTINATION bin) + if(MSVC) + install(FILES "$<TARGET_PDB_FILE:${name}>" DESTINATION bin OPTIONAL) + endif() endfunction() add_util(enum_symbols enum_symbols.cpp command_line.hpp pdb_descr.hpp) |
