Win-specific: Tune code for compilation with MS Visual Studio

This commit is contained in:
Abs62 2016-04-08 00:45:27 +03:00
parent 81a7ea2983
commit 032f5c8337
12 changed files with 42 additions and 20 deletions

View file

@ -86,6 +86,17 @@ Then, invoke `make clean` before `make` because the setting change:
make clean && make
### Building under Windows with MS Visual Studio
To build GoldenDict with Visual Studio take one of next library packs and unpack it to `"winlibs/lib/msvc"` folder in GoldenDict sources folder.
[GoldenDict_libs_VS2013_x86.7z](http://www.mediafire.com/download/d3jrbsnco6ox4d8/GoldenDict_libs_VS2013_x86.7z) - for MS Visual Studio 2013, 32 bit
[GoldenDict_libs_VS2013_x64.7z](http://www.mediafire.com/download/21lun6uj51hnk3s/GoldenDict_libs_VS2013_x64.7z) - for MS Visual Studio 2013, 64 bit
To create project files for Visual Studio you can pass `"-tp vc"` option to `qmake`.
Note: In Qt 5.6.0 and later the `Webkit` module was removed from official release builds. You should to build it from sources to compile GoldenDict.
## Installation
Installation is an optional step since the built binary can be used as-is without installation. But you can properly install via:

View file

@ -1,7 +1,7 @@
/* This file is (c) 2008-2012 Konstantin Isakov <ikm@goldendict.org>
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
#ifdef _MSC_VER
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>

View file

@ -27,7 +27,7 @@
#include <string>
#include <vector>
#include <qglobal.h>
#ifdef _MSC_VER
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>

View file

@ -14,7 +14,7 @@
#include <QSet>
#include <QList>
#ifdef _MSC_VER
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>

View file

@ -5,13 +5,6 @@
#include <zlib.h>
#include <string.h>
#ifdef _MSC_VER
#include <stdint_msvc.h>
#else
#include <stdint.h>
#endif
namespace ChunkedStorage {
enum

View file

@ -8,7 +8,7 @@
#include "file.hh"
#include <vector>
#ifdef _MSC_VER
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>

View file

@ -7,7 +7,7 @@
#include <QtXml>
#include "gddebug.hh"
#ifdef _MSC_VER
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>

View file

@ -18,6 +18,10 @@
#include <vector>
#include <string>
#ifdef _MSC_VER
#include <stub_msvc.h>
#endif
#include <eb/eb.h>
namespace Epwing {

View file

@ -44,14 +44,14 @@ win32 {
DEFINES += __WIN32 _CRT_SECURE_NO_WARNINGS
contains(QMAKE_TARGET.arch, x86_64) {
DEFINES += NOMINMAX __WIN64
LIBS += -L$${PWD}/winlibs/lib/msvc/x64
} else {
LIBS += -L$${PWD}/winlibs/lib/msvc
}
LIBS += -L$${PWD}/winlibs/lib/msvc
QMAKE_CXXFLAGS += /wd4290 # silence the warning C4290: C++ exception specification ignored
QMAKE_LFLAGS_RELEASE += /LTCG /OPT:REF /OPT:ICF
QMAKE_LFLAGS_RELEASE += /OPT:REF /OPT:ICF
# QMAKE_CXXFLAGS_RELEASE += /GL # slows down the linking significantly
LIBS += -lshell32 -luser32 -lsapi -lole32 -lhunspell
LIBS += -lshell32 -luser32 -lsapi -lole32
Debug: LIBS+= -lhunspelld
Release: LIBS+= -lhunspell
HUNSPELL_LIB = hunspell
} else {
LIBS += -lhunspell-1.3.2
@ -483,7 +483,12 @@ CONFIG( chinese_conversion_support ) {
chineseconversion.hh
SOURCES += chinese.cc \
chineseconversion.cc
win32-msvc* {
Debug: LIBS += -lopenccd
Release: LIBS += -lopencc
} else {
LIBS += -lopencc
}
}
RESOURCES += resources.qrc \

View file

@ -4,6 +4,10 @@
#ifndef __HUNSPELL_HH_INCLUDED__
#define __HUNSPELL_HH_INCLUDED__
#ifdef _MSC_VER
#define HUNSPELL_STATIC
#endif
#include "dictionary.hh"
#include "config.hh"

View file

@ -2,7 +2,8 @@
#include "langcoder.hh"
#include <map>
#include <QCoreApplication>
#ifdef _MSC_VER
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>

View file

@ -19,9 +19,13 @@
#ifndef __RIPEMD_HH_INCLUDED__
#define __RIPEMD_HH_INCLUDED__
#include <stdint.h>
#include <stddef.h>
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>
#endif
class RIPEMD128
{