use a dynamic library for minidump shared code

This has the disadvantage to make the minidump_upload executable depend on LibreOffice libraries but there seems to be no other way to make the 7.1 SDK happy.

Change-Id: I82c37f503ed29cb50711eae7db22063f49747a48
Reviewed-on: https://gerrit.libreoffice.org/26055
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 3498cd3e7b2c820fc3f3025eb4434666a444fda1)
Reviewed-on: https://gerrit.libreoffice.org/26915
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Markus Mohrhard
2016-06-08 12:14:30 +02:00
committed by Christian Lohmaier
parent 7001ca25ec
commit f4c68d3ad8
8 changed files with 24 additions and 15 deletions

View File

@@ -10,11 +10,12 @@
$(eval $(call gb_Executable_Executable,minidump_upload)) $(eval $(call gb_Executable_Executable,minidump_upload))
$(eval $(call gb_Executable_use_libraries,minidump_upload,\ $(eval $(call gb_Executable_use_libraries,minidump_upload,\
crashreport \
sal \ sal \
)) ))
$(eval $(call gb_Executable_use_static_libraries,minidump_upload,\ $(eval $(call gb_Executable_add_defs,minidump_upload,\
minidump \ -DUNICODE \
)) ))
$(eval $(call gb_Executable_use_external,minidump_upload,curl)) $(eval $(call gb_Executable_use_external,minidump_upload,curl))

View File

@@ -14,7 +14,10 @@ $(eval $(call gb_Library_set_include,crashreport,\
-I$(SRCDIR)/desktop/inc \ -I$(SRCDIR)/desktop/inc \
)) ))
$(eval $(call gb_Library_use_external,crashreport,breakpad)) $(eval $(call gb_Library_use_externals,crashreport,\
breakpad \
curl \
))
$(eval $(call gb_Library_add_defs,crashreport,\ $(eval $(call gb_Library_add_defs,crashreport,\
-DCRASHREPORT_DLLIMPLEMENTATION \ -DCRASHREPORT_DLLIMPLEMENTATION \
@@ -38,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,crashreport,\
$(eval $(call gb_Library_add_exception_objects,crashreport,\ $(eval $(call gb_Library_add_exception_objects,crashreport,\
desktop/source/app/crashreport \ desktop/source/app/crashreport \
desktop/source/minidump/minidump \
)) ))

View File

@@ -19,7 +19,7 @@ $(eval $(call gb_Module_add_targets,desktop,\
Library_sofficeapp \ Library_sofficeapp \
$(if $(ENABLE_BREAKPAD), \ $(if $(ENABLE_BREAKPAD), \
Library_crashreport \ Library_crashreport \
StaticLibrary_minidump) \ ) \
$(if $(ENABLE_HEADLESS),,Library_spl) \ $(if $(ENABLE_HEADLESS),,Library_spl) \
Package_branding \ Package_branding \
$(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \ $(if $(CUSTOM_BRAND_DIR),Package_branding_custom) \

View File

@@ -13,6 +13,7 @@
#include <memory> #include <memory>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <string>
#include <curl/curl.h> #include <curl/curl.h>
@@ -178,6 +179,8 @@ bool uploadContent(std::map<std::string, std::string>& parameters, std::string&
return true; return true;
} }
namespace crashreport {
bool readConfig(const std::string& iniPath, std::string& response) bool readConfig(const std::string& iniPath, std::string& response)
{ {
std::ifstream file(iniPath); std::ifstream file(iniPath);
@@ -199,4 +202,6 @@ bool readConfig(const std::string& iniPath, std::string& response)
return uploadContent(parameters, response); return uploadContent(parameters, response);
} }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -10,6 +10,7 @@
#include <desktop/minidump.hxx> #include <desktop/minidump.hxx>
#include <iostream> #include <iostream>
#include <string>
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
@@ -21,7 +22,7 @@ int main(int argc, char** argv)
std::string iniPath(argv[1]); std::string iniPath(argv[1]);
std::string response; std::string response;
if (!readConfig(iniPath, response)) if (!crashreport::readConfig(iniPath, response))
return EXIT_FAILURE; return EXIT_FAILURE;
std::cout << "Response: " << response << std::endl; std::cout << "Response: " << response << std::endl;

View File

@@ -12,7 +12,13 @@
#include <string> #include <string>
bool readConfig(const std::string& iniPath, std::string& response); #include <desktop/dllapi.h>
namespace crashreport {
CRASHREPORT_DLLPUBLIC bool readConfig(const std::string& iniPath, std::string& response);
}
#endif #endif

View File

@@ -40,14 +40,6 @@ $(eval $(call gb_Library_add_defs,svx,\
$(eval $(call gb_Library_set_precompiled_header,svx,$(SRCDIR)/svx/inc/pch/precompiled_svx)) $(eval $(call gb_Library_set_precompiled_header,svx,$(SRCDIR)/svx/inc/pch/precompiled_svx))
ifeq ($(ENABLE_BREAKPAD),TRUE)
$(eval $(call gb_Library_use_static_libraries,svx, \
minidump \
))
endif
$(eval $(call gb_Library_use_libraries,svx,\ $(eval $(call gb_Library_use_libraries,svx,\
basegfx \ basegfx \
sb \ sb \

View File

@@ -60,7 +60,7 @@ IMPL_LINK_TYPED(CrashReportDialog, BtnHdl, Button*, pBtn, void)
std::string ini_path = CrashReporter::getIniFileName(); std::string ini_path = CrashReporter::getIniFileName();
std::string response; std::string response;
bool bSuccess = readConfig(ini_path, response); bool bSuccess = crashreport::readConfig(ini_path, response);
OUString aCrashID = OUString::createFromAscii(response.c_str()); OUString aCrashID = OUString::createFromAscii(response.c_str());