fix: mingw build

This commit is contained in:
Sen66
2026-03-01 23:58:06 +01:00
parent 9f285b37b2
commit d38cb02fa2
3 changed files with 38 additions and 1 deletions

View File

@@ -36,6 +36,13 @@ file(GLOB RAW_PDB_SRCS third_party/raw_pdb/src/*.cpp)
add_library(raw_pdb STATIC ${RAW_PDB_SRCS})
target_include_directories(raw_pdb PUBLIC third_party/raw_pdb/src)
target_compile_features(raw_pdb PRIVATE cxx_std_11)
# PDB_CRT.h forward-declares printf/memcmp/etc with __cdecl which conflicts
# with MinGW. Force-include a prefix header that pulls in the real CRT headers
# and strips __cdecl so the redeclarations are compatible.
if(MINGW)
target_compile_options(raw_pdb PUBLIC
-include "${CMAKE_CURRENT_SOURCE_DIR}/cmake/raw_pdb_prefix.h")
endif()
if(WIN32)
target_link_libraries(raw_pdb PRIVATE rpcrt4)
endif()