[crashrpt] Fix build error (#26231)

* [crashrpt] Fix build error

* x-add-version

* fix build error

* add license

* x-add-version

* Correct license

Co-authored-by: Billy O'Neal <bion@microsoft.com>
This commit is contained in:
Lily Wang 2022-08-09 13:58:37 -07:00 committed by GitHub
parent ce4aaba77f
commit e47ff308b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 207 additions and 11 deletions

View File

@ -0,0 +1,148 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed9e3d3..d842aa7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,7 @@ if(NOT TINYXML_INCLUDE_DIR)
message(FATAL_ERROR "tinyxml include dir not found")
endif()
-find_path(WTL_INCLUDE_DIR wtl/atlapp.h)
+find_path(WTL_INCLUDE_DIR atlapp.h)
if(NOT WTL_INCLUDE_DIR)
message(FATAL_ERROR "WTL include dir not found")
endif()
diff --git a/processing/crashrptprobe/CrashRptProbe.rc b/processing/crashrptprobe/CrashRptProbe.rc
index e12b8e9..a08f63e 100644
--- a/processing/crashrptprobe/CrashRptProbe.rc
+++ b/processing/crashrptprobe/CrashRptProbe.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "wtl/atlres.h"
+#include "atlres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -32,7 +32,7 @@ END
2 TEXTINCLUDE
BEGIN
- "#include ""wtl/atlres.h""\r\n"
+ "#include ""atlres.h""\r\n"
"\0"
END
diff --git a/processing/crashrptprobe/stdafx.h b/processing/crashrptprobe/stdafx.h
index 0b60659..2b027b2 100644
--- a/processing/crashrptprobe/stdafx.h
+++ b/processing/crashrptprobe/stdafx.h
@@ -70,13 +70,13 @@ namespace ATL
};
#endif // _WTL_SUPPORT_SDK_ATL3
-#include <wtl/atlapp.h>
+#include <atlapp.h>
extern CAppModule _Module;
#include <atlwin.h>
// CString-related includes
#define _WTL_USE_CSTRING
-#include <wtl/atlmisc.h>
+#include <atlmisc.h>
#if _MSC_VER<1400
#define WCSNCPY_S(strDest, sizeInBytes, strSource, count) wcsncpy(strDest, strSource, count)
diff --git a/reporting/crashrpt/CrashRpt.rc b/reporting/crashrpt/CrashRpt.rc
index a8c821b..95e7502 100644
--- a/reporting/crashrpt/CrashRpt.rc
+++ b/reporting/crashrpt/CrashRpt.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "wtl/atlres.h"
+#include "atlres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -32,7 +32,7 @@ END
2 TEXTINCLUDE
BEGIN
- "#include ""wtl/atlres.h""\r\n"
+ "#include ""atlres.h""\r\n"
"\0"
END
diff --git a/reporting/crashrpt/StdAfx.h b/reporting/crashrpt/StdAfx.h
index 13bbe50..3ed0a55 100644
--- a/reporting/crashrpt/StdAfx.h
+++ b/reporting/crashrpt/StdAfx.h
@@ -54,12 +54,12 @@ namespace ATL
};
#endif // _WTL_SUPPORT_SDK_ATL3
-#include <wtl/atlapp.h>
+#include <atlapp.h>
extern CAppModule _Module;
#include <atlwin.h>
// CString-related includes
#define _WTL_USE_CSTRING
-#include <wtl/atlmisc.h>
+#include <atlmisc.h>
#include <new.h>
#include <map>
#include <set>
diff --git a/reporting/crashsender/CrashSender.rc b/reporting/crashsender/CrashSender.rc
index e10e269..0502962 100644
--- a/reporting/crashsender/CrashSender.rc
+++ b/reporting/crashsender/CrashSender.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "wtl/atlres.h"
+#include "atlres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -243,7 +243,7 @@ END
2 TEXTINCLUDE
BEGIN
- "#include ""wtl/atlres.h""\r\n"
+ "#include ""atlres.h""\r\n"
"\0"
END
diff --git a/reporting/crashsender/stdafx.h b/reporting/crashsender/stdafx.h
index 4494d3a..9bbbe3a 100644
--- a/reporting/crashsender/stdafx.h
+++ b/reporting/crashsender/stdafx.h
@@ -61,19 +61,19 @@ namespace ATL
};
#endif // _WTL_SUPPORT_SDK_ATL3
-#include <wtl/atlapp.h>
+#include <atlapp.h>
extern CAppModule _Module;
#include <atlwin.h>
-#include <wtl/atlframe.h>
-#include <wtl/atlctrls.h>
-#include <wtl/atldlgs.h>
-#include <wtl/atlctrlx.h>
+#include <atlframe.h>
+#include <atlctrls.h>
+#include <atldlgs.h>
+#include <atlctrlx.h>
#define _WTL_USE_CSTRING
-#include <wtl/atlmisc.h>
+#include <atlmisc.h>
#include <string>
#include <vector>

View File

@ -0,0 +1,39 @@
diff --git a/processing/crashrptprobe/CMakeLists.txt b/processing/crashrptprobe/CMakeLists.txt
index c513c6d..8ac306a 100644
--- a/processing/crashrptprobe/CMakeLists.txt
+++ b/processing/crashrptprobe/CMakeLists.txt
@@ -13,7 +13,7 @@ list(REMOVE_ITEM srcs_using_precomp ./CrashRptProbe.rc ./CrashRptProbe.def ./st
add_msvc_precompiled_header(stdafx.h ./stdafx.cpp srcs_using_precomp)
# Define _UNICODE (use wide-char encoding)
-add_definitions(-D_UNICODE)
+add_definitions(-D_UNICODE -DUNICODE)
fix_default_compiler_settings_()
diff --git a/reporting/crashrpt/CMakeLists.txt b/reporting/crashrpt/CMakeLists.txt
index c7e4fd6..da9cef1 100644
--- a/reporting/crashrpt/CMakeLists.txt
+++ b/reporting/crashrpt/CMakeLists.txt
@@ -12,7 +12,7 @@ list(REMOVE_ITEM srcs_using_precomp ./CrashRpt.rc ./StdAfx.cpp ./CrashRpt.def)
add_msvc_precompiled_header(stdafx.h ./StdAfx.cpp srcs_using_precomp)
# Define _UNICODE (use wide-char encoding)
-add_definitions(-D_UNICODE -D_CRT_SECURE_NO_DEPRECATE)
+add_definitions(-D_UNICODE -DUNICODE -D_CRT_SECURE_NO_DEPRECATE)
# Modify default compiler settings
fix_default_compiler_settings_()
diff --git a/reporting/crashsender/CMakeLists.txt b/reporting/crashsender/CMakeLists.txt
index aa4ab8a..f081254 100644
--- a/reporting/crashsender/CMakeLists.txt
+++ b/reporting/crashsender/CMakeLists.txt
@@ -15,7 +15,7 @@ list(APPEND source_files
${CMAKE_SOURCE_DIR}/reporting/CrashRpt/SharedMem.cpp)
# Define _UNICODE (use wide-char encoding)
-add_definitions(-D_UNICODE )
+add_definitions(-D_UNICODE -DUNICODE)
fix_default_compiler_settings_()

View File

@ -12,13 +12,15 @@ vcpkg_from_git(
REF 4616504670be5a425a525376648d912a72ce18f2
PATCHES
001-add-install-target-and-find-deps.patch
002-fix-wtl-includepath.patch
003-add-definition-UNICODE.patch
)
# Remove vendored dependencies to ensure they are not picked up by the build
# Vendored minizip is still used since it contains modifications needed for CrashRpt
foreach(DEPENDENCY dbghelp jpeg libogg libpng libtheora tinyxml wtl zlib)
if(EXISTS ${SOURCE_PATH}/thirdparty/${DEPENDENCY})
file(REMOVE_RECURSE ${SOURCE_PATH}/thirdparty/${DEPENDENCY})
if(EXISTS "${SOURCE_PATH}/thirdparty/${DEPENDENCY}")
file(REMOVE_RECURSE "${SOURCE_PATH}/thirdparty/${DEPENDENCY}")
endif()
endforeach()
@ -32,21 +34,18 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
demos CRASHRPT_BUILD_DEMOS
)
# PREFER_NINJA is not used below since CrashSender fails to build with errors like this one:
# C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\ATLMFC\include\atlconv.h(788): error C2440: 'return': cannot convert from 'LPCTSTR' to 'LPCOLESTR'
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
# PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCRASHRPT_BUILD_SHARED_LIBS=${CRASHRPT_BUILD_SHARED_LIBS}
-DCRASHRPT_LINK_CRT_AS_DLL=${CRASHRPT_LINK_CRT_AS_DLL}
${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/License.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,9 +1,10 @@
{
"name": "crashrpt",
"version": "1.4.3",
"port-version": 2,
"port-version": 3,
"description": "A crash reporting system for Windows applications",
"homepage": "http://crashrpt.sourceforge.net/",
"license": "BSD-3-Clause",
"supports": "!osx & !linux & !uwp & (x86 | x64)",
"dependencies": [
"dbghelp",
@ -12,6 +13,10 @@
"libpng",
"libtheora",
"tinyxml",
{
"name": "vcpkg-cmake",
"host": true
},
"wtl",
"zlib"
],

View File

@ -1706,7 +1706,7 @@
},
"crashrpt": {
"baseline": "1.4.3",
"port-version": 2
"port-version": 3
},
"crc32c": {
"baseline": "1.1.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bb5e94d69da827d776c42545cdda4ca0e5565629",
"version": "1.4.3",
"port-version": 3
},
{
"git-tree": "896d96ee0613edabd92048142803845fa11baa68",
"version": "1.4.3",