Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Third-party library updates #15

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 10 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Preserve backwards compatibility
cmake_minimum_required (VERSION 3.1)
cmake_minimum_required (VERSION 3.15)
project (CrashRpt)

# CrashRpt version number
Expand All @@ -17,7 +17,7 @@ option(CRASHRPT_BUILD_DEMOS "If set (default), CrashRpt builds the demo projects
option(CRASHRPT_BUILD_TESTS "If set (default), CrashRpt builds the test projects." ON)
option(CRASHRPT_INSTALL_PDB "If set (default), CrashRpt also installs PDB files." ON)

ADD_DEFINITIONS("/W4 /wd4456 /wd4458 /MP /Oy- /EHsc")
add_compile_options( /W4 /wd4456 /wd4458 /MP /Oy- /EHsc )

if(MSVC_VERSION LESS 1910 )
set( DBGHELP_USE_INSTALLED_SDK True )
Expand Down Expand Up @@ -86,16 +86,15 @@ macro(fix_default_compiler_settings_)
if (MSVC)
# For MSVC, CMake sets certain flags to defaults we want to override.
# This replacement code is taken from sample in the CMake Wiki at
# http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.
foreach (flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE )
if (NOT CRASHRPT_LINK_CRT_AS_DLL)
string(REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(NOT CRASHRPT_LINK_CRT_AS_DLL)

# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#dynamic-replace.
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD" AND NOT CRASHRPT_LINK_CRT_AS_DLL)
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
endforeach()
endif(MSVC)
endif(MSVC)
endmacro()

fix_default_compiler_settings_()
Expand Down
16 changes: 8 additions & 8 deletions demos/ConsoleDemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ project(ConsoleDemo)
aux_source_directory( . source_files )
file( GLOB header_files *.h )

# Define _UNICODE (use wide-char encoding)
add_definitions(-D_UNICODE )
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

fix_default_compiler_settings_()

# Add include dir
include_directories(${CMAKE_SOURCE_DIR}/include
include_directories(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/reporting/CrashRpt
${CMAKE_SOURCE_DIR}/thirdparty/wtl
${CMAKE_SOURCE_DIR}/thirdparty/wtl
${CMAKE_SOURCE_DIR}/thirdparty/zlib
${CMAKE_SOURCE_DIR}/thirdparty/minizip
${CMAKE_SOURCE_DIR}/thirdparty/jpeg
${CMAKE_SOURCE_DIR}/thirdparty/libpng
${CMAKE_SOURCE_DIR}/thirdparty/minizip
${CMAKE_SOURCE_DIR}/thirdparty/jpeg
${CMAKE_SOURCE_DIR}/thirdparty/libpng
${CMAKE_SOURCE_DIR}/thirdparty/tinyxml )

# Add executable build target
Expand All @@ -29,4 +29,4 @@ set_target_properties(ConsoleDemo PROPERTIES DEBUG_POSTFIX d )

INSTALL(TARGETS ConsoleDemo LIBRARY DESTINATION ${CRASHRPT_INSTALLDIR_BIN}
ARCHIVE DESTINATION ${CRASHRPT_INSTALLDIR_LIB}
RUNTIME DESTINATION ${CRASHRPT_INSTALLDIR_BIN})
RUNTIME DESTINATION ${CRASHRPT_INSTALLDIR_BIN})
20 changes: 12 additions & 8 deletions demos/MFCDemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ list(REMOVE_ITEM srcs_using_precomp ./stdafx.cpp)
add_msvc_precompiled_header(stdafx.h ./stdafx.cpp srcs_using_precomp)

# Use MFC
ADD_DEFINITIONS(-D_AFXDLL)
if (CRASHRPT_LINK_CRT_AS_DLL)
add_compile_definitions( _AFXDLL )
if (CRASHRPT_LINK_CRT_AS_DLL)
# Use MFC as a shared lib
SET(CMAKE_MFC_FLAG 2)
else(CRASHRPT_LINK_CRT_AS_DLL)
SET(CMAKE_MFC_FLAG 2)
else(CRASHRPT_LINK_CRT_AS_DLL)
# Use MFC as a static lib
SET(CMAKE_MFC_FLAG 1)
endif(CRASHRPT_LINK_CRT_AS_DLL)
SET(CMAKE_MFC_FLAG 1)
endif(CRASHRPT_LINK_CRT_AS_DLL)

# Include resource file
list(APPEND source_files ./MFCDemo.rc )

# Define _UNICODE (use wide-char encoding)
add_definitions(-D_UNICODE )
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

fix_default_compiler_settings_()

Expand All @@ -33,6 +33,10 @@ include_directories(${CMAKE_SOURCE_DIR}/include)
# Add executable build target
add_executable(MFCDemo WIN32 ${source_files} ${header_files})

# Workaround for WinMain linker error during Unicode build
# https://gitlab.kitware.com/cmake/cmake/-/issues/21202
target_link_options(MFCDemo PRIVATE "/entry:wWinMainCRTStartup")

# Add input link libraries
target_link_libraries(MFCDemo CrashRpt)

Expand Down
6 changes: 3 additions & 3 deletions demos/MFCDemo/stdafx.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*************************************************************************************
/*************************************************************************************
This file is a part of CrashRpt library.
Copyright (c) 2003-2013 The CrashRpt project authors. All Rights Reserved.

Expand Down Expand Up @@ -28,9 +28,9 @@ be found in the Authors.txt file in the root of the source tree.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#endif

#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
Expand Down
7 changes: 3 additions & 4 deletions demos/WTLDemo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ add_msvc_precompiled_header(stdafx.h ./stdafx.cpp srcs_using_precomp)
# Include resource file
list(APPEND source_files ./WTLDemo.rc )

# Define _UNICODE (use wide-char encoding)
add_definitions(-D_UNICODE )
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

fix_default_compiler_settings_()

# Add include dir
include_directories(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/thirdparty/wtl)
include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/thirdparty/wtl )

# Add executable build target
add_executable(WTLDemo WIN32 ${source_files} ${header_files})
Expand Down
10 changes: 5 additions & 5 deletions demos/WTLDemo/stdafx.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*************************************************************************************
/*************************************************************************************
This file is a part of CrashRpt library.
Copyright (c) 2003-2013 The CrashRpt project authors. All Rights Reserved.

Expand All @@ -16,10 +16,10 @@ be found in the Authors.txt file in the root of the source tree.
#pragma once

// Change these values to use different versions
#define WINVER 0x0500
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#define _WIN32_IE 0x0501
#define _RICHEDIT_VER 0x0200
#define _WIN32_IE 0x0600
#define _RICHEDIT_VER 0x0300

#include <atldef.h>
#if ( _ATL_VER < 0x0800 )
Expand Down Expand Up @@ -75,6 +75,6 @@ extern CAppModule _Module;
#else
#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif
#endif


10 changes: 5 additions & 5 deletions processing/crashrptprobe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(CrashRptProbe)
aux_source_directory( . source_files )
file( GLOB header_files *.h )

list(APPEND source_files
list(APPEND source_files
./CrashRptProbe.rc
./CrashRptProbe.def
${CMAKE_SOURCE_DIR}/reporting/crashrpt/Utility.cpp
Expand All @@ -16,8 +16,8 @@ set(srcs_using_precomp ${source_files})
list(REMOVE_ITEM srcs_using_precomp ./CrashRptProbe.rc ./CrashRptProbe.def ./stdafx.cpp ${CMAKE_SOURCE_DIR}/reporting/crashsender/md5.cpp)
add_msvc_precompiled_header(stdafx.h ./stdafx.cpp srcs_using_precomp)

# Define _UNICODE (use wide-char encoding)
add_definitions(-D_UNICODE)
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

fix_default_compiler_settings_()

Expand Down Expand Up @@ -62,9 +62,9 @@ else(CRASHRPT_BUILD_SHARED_LIBS)
MINSIZEREL_POSTFIX LIB)
endif(CRASHRPT_BUILD_SHARED_LIBS)

INSTALL(TARGETS CrashRptProbe
INSTALL(TARGETS CrashRptProbe
LIBRARY DESTINATION ${CRASHRPT_INSTALLDIR_BIN}
ARCHIVE DESTINATION ${CRASHRPT_INSTALLDIR_LIB}
RUNTIME DESTINATION ${CRASHRPT_INSTALLDIR_BIN})

install(FILES $<TARGET_PDB_FILE:CrashRptProbe> DESTINATION ${CRASHRPT_INSTALLDIR_BIN})
install(FILES $<TARGET_PDB_FILE:CrashRptProbe> DESTINATION ${CRASHRPT_INSTALLDIR_BIN})
4 changes: 2 additions & 2 deletions processing/crprober/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ project(crprober)
aux_source_directory( . source_files )
file( GLOB header_files *.h )

# Define _UNICODE (use wide-char encoding)
add_definitions(-D_UNICODE )
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

fix_default_compiler_settings_()

Expand Down
8 changes: 4 additions & 4 deletions reporting/crashrpt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ set(srcs_using_precomp ${source_files})
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)
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

# Modify default compiler settings
fix_default_compiler_settings_()

# Add include dir
include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/thirdparty/wtl)
include_directories( ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/thirdparty/wtl )

# Add library build target
if(CRASHRPT_BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -46,7 +46,7 @@ else(CRASHRPT_BUILD_SHARED_LIBS)
)
endif(CRASHRPT_BUILD_SHARED_LIBS)

INSTALL(TARGETS CrashRpt
INSTALL(TARGETS CrashRpt
LIBRARY DESTINATION ${CRASHRPT_INSTALLDIR_BIN}
ARCHIVE DESTINATION ${CRASHRPT_INSTALLDIR_LIB}
RUNTIME DESTINATION ${CRASHRPT_INSTALLDIR_BIN}
Expand Down
2 changes: 1 addition & 1 deletion reporting/crashrpt/StdAfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ be found in the Authors.txt file in the root of the source tree.
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#define _WIN32_IE 0x0600
#define _RICHEDIT_VER 0x0200
#define _RICHEDIT_VER 0x0300

#include <errno.h>
#include <atldef.h>
Expand Down
8 changes: 4 additions & 4 deletions reporting/crashsender/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ list(APPEND source_files
${CMAKE_SOURCE_DIR}/reporting/CrashRpt/SharedMem.cpp
)

# Define _UNICODE (use wide-char encoding)
add_definitions(-D_UNICODE )
# Define _UNICODE and UNICODE (use wide-char encoding)
add_compile_definitions( _UNICODE UNICODE )

fix_default_compiler_settings_()

Expand Down Expand Up @@ -45,7 +45,7 @@ endif(NOT CMAKE_CL_64)
add_executable(CrashSender WIN32 ${source_files} ${header_files})

# Add input link libraries
target_link_libraries(CrashSender
target_link_libraries(CrashSender
zlib
minizip
libjpeg
Expand All @@ -71,7 +71,7 @@ set_target_properties(CrashSender PROPERTIES
MINSIZEREL_POSTFIX ${CRASHRPT_VER}
)

INSTALL(TARGETS CrashSender
INSTALL(TARGETS CrashSender
LIBRARY DESTINATION ${CRASHRPT_INSTALLDIR_BIN}
ARCHIVE DESTINATION ${CRASHRPT_INSTALLDIR_LIB}
RUNTIME DESTINATION ${CRASHRPT_INSTALLDIR_BIN}
Expand Down
2 changes: 1 addition & 1 deletion reporting/crashsender/ErrorReportDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ LRESULT CErrorReportDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /
// If there is no icon in crashed EXE module, use default IDI_APPLICATION system icon.
if(m_HeadingIcon == NULL)
{
m_HeadingIcon = ::LoadIcon(NULL, MAKEINTRESOURCE(IDI_APPLICATION));
m_HeadingIcon = ::LoadIcon(NULL, IDI_APPLICATION);
}

// Init controls.
Expand Down
Loading