mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-15 01:17:16 -05:00
Merge pull request #1607 from PhenomRetroShare/Fix_CMark_Compil
Fix CMark compilation
This commit is contained in:
commit
e31b7c2816
@ -22,7 +22,7 @@ before_install:
|
|||||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew install ccach; export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi
|
- if [ $TRAVIS_OS_NAME == osx ]; then brew install ccach; export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi
|
||||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew install qt5; fi
|
- if [ $TRAVIS_OS_NAME == osx ]; then brew install qt5; fi
|
||||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt5 ; fi
|
- if [ $TRAVIS_OS_NAME == osx ]; then brew link --force qt5 ; fi
|
||||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew install openssl miniupnpc libmicrohttpd sqlcipher xapian; fi
|
- if [ $TRAVIS_OS_NAME == osx ]; then brew install openssl miniupnpc libmicrohttpd sqlcipher xapian cmark; fi
|
||||||
- if [ $TRAVIS_OS_NAME == osx ]; then brew install p7zip; fi
|
- if [ $TRAVIS_OS_NAME == osx ]; then brew install p7zip; fi
|
||||||
- if [ $TRAVIS_OS_NAME == osx ]; then npm install -g appdmg; fi
|
- if [ $TRAVIS_OS_NAME == osx ]; then npm install -g appdmg; fi
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ install:
|
|||||||
# Configuring MSys2
|
# Configuring MSys2
|
||||||
- set PATH=C:\msys64\usr\bin;%PATH%
|
- set PATH=C:\msys64\usr\bin;%PATH%
|
||||||
- set PATH=C:\msys64\mingw32\bin;%PATH%
|
- set PATH=C:\msys64\mingw32\bin;%PATH%
|
||||||
- pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd mingw-w64-i686-xapian-core
|
- pacman --noconfirm -S mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd mingw-w64-i686-xapian-core mingw-w64-i686-cmark
|
||||||
#- pacman --noconfirm -S mingw-w64-i686-qt5-static mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd
|
#- pacman --noconfirm -S mingw-w64-i686-qt5-static mingw-w64-i686-miniupnpc mingw-w64-i686-sqlcipher mingw-w64-i686-libmicrohttpd
|
||||||
#- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH%
|
#- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH%
|
||||||
|
|
||||||
@ -146,6 +146,7 @@ before_package:
|
|||||||
# to run your custom scripts instead of automatic MSBuild
|
# to run your custom scripts instead of automatic MSBuild
|
||||||
build_script:
|
build_script:
|
||||||
- env
|
- env
|
||||||
|
- git submodule update --init
|
||||||
- qmake -Wall -spec win32-g++ "CONFIG=debug"
|
- qmake -Wall -spec win32-g++ "CONFIG=debug"
|
||||||
- mingw32-make -j3
|
- mingw32-make -j3
|
||||||
|
|
||||||
@ -245,6 +246,10 @@ after_build:
|
|||||||
- copy C:\msys64\mingw32\bin\libunistring*.dll %RS_DEPLOY%\
|
- copy C:\msys64\mingw32\bin\libunistring*.dll %RS_DEPLOY%\
|
||||||
- copy C:\msys64\mingw32\bin\libffi*.dll %RS_DEPLOY%\
|
- copy C:\msys64\mingw32\bin\libffi*.dll %RS_DEPLOY%\
|
||||||
|
|
||||||
|
## Needed for cmark
|
||||||
|
- copy C:\msys64\mingw32\bin\libcmark*.dll %RS_DEPLOY%\
|
||||||
|
- copy C:\msys64\mingw32\bin\libdouble-conversion*.dll %RS_DEPLOY%\
|
||||||
|
|
||||||
- find C:\projects\RetroShare >> filelist.txt
|
- find C:\projects\RetroShare >> filelist.txt
|
||||||
|
|
||||||
# to disable automatic builds
|
# to disable automatic builds
|
||||||
|
@ -43,6 +43,46 @@ rs_jsonapi {
|
|||||||
FORMS *= gui/settings/JsonApiPage.ui
|
FORMS *= gui/settings/JsonApiPage.ui
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Auto detect installed version of cmark
|
||||||
|
rs_gui_cmark {
|
||||||
|
DEFINES *= USE_CMARK
|
||||||
|
no_rs_cross_compiling {
|
||||||
|
message("Using compiled cmark")
|
||||||
|
CMARK_SRC_PATH=$$clean_path($${RS_SRC_PATH}/supportlibs/cmark)
|
||||||
|
CMARK_BUILD_PATH=$$clean_path($${RS_BUILD_PATH}/supportlibs/cmark/build)
|
||||||
|
INCLUDEPATH *= $$clean_path($${RS_SRC_PATH}/src/)
|
||||||
|
DEPENDPATH *= $$clean_path($${RS_SRC_PATH}/src/)
|
||||||
|
QMAKE_LIBDIR *= $$clean_path($${CMARK_BUILD_PATH}/)
|
||||||
|
# Using sLibs would fail as libcmark.a is generated at compile-time
|
||||||
|
LIBS *= -L$$clean_path($${CMARK_BUILD_PATH}/src/) -lcmark
|
||||||
|
|
||||||
|
DUMMYCMARKINPUT = FORCE
|
||||||
|
CMAKE_GENERATOR_OVERRIDE=""
|
||||||
|
win32-g++:CMAKE_GENERATOR_OVERRIDE="-G \"MSYS Makefiles\""
|
||||||
|
gencmarklib.name = Generating libcmark.
|
||||||
|
gencmarklib.input = DUMMYCMARKINPUT
|
||||||
|
gencmarklib.output = $$clean_path($${CMARK_BUILD_PATH}/src/libcmark.a)
|
||||||
|
gencmarklib.CONFIG += target_predeps combine
|
||||||
|
gencmarklib.variable_out = PRE_TARGETDEPS
|
||||||
|
gencmarklib.commands = \
|
||||||
|
cd $${RS_SRC_PATH} && ( \
|
||||||
|
git submodule update --init supportlibs/cmark ; \
|
||||||
|
cd $${CMARK_SRC_PATH} ; \
|
||||||
|
true ) && \
|
||||||
|
mkdir -p $${CMARK_BUILD_PATH} && cd $${CMARK_BUILD_PATH} && \
|
||||||
|
cmake \
|
||||||
|
-DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
|
||||||
|
$${CMAKE_GENERATOR_OVERRIDE} \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=. \
|
||||||
|
-B. \
|
||||||
|
-H$$shell_path($${CMARK_SRC_PATH}) && \
|
||||||
|
$(MAKE)
|
||||||
|
QMAKE_EXTRA_COMPILERS += gencmarklib
|
||||||
|
} else {
|
||||||
|
message("Using systems cmark")
|
||||||
|
sLibs *= libcmark
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FORMS += TorControl/TorControlWindow.ui
|
FORMS += TorControl/TorControlWindow.ui
|
||||||
SOURCES += TorControl/TorControlWindow.cpp
|
SOURCES += TorControl/TorControlWindow.cpp
|
||||||
@ -81,7 +121,7 @@ MOC_DIR = temp/moc
|
|||||||
################################# Linux ##########################################
|
################################# Linux ##########################################
|
||||||
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
# Put lib dir in QMAKE_LFLAGS so it appears before -L/usr/lib
|
||||||
linux-* {
|
linux-* {
|
||||||
CONFIG += link_pkgconfig
|
CONFIG += link_pkgconfig
|
||||||
|
|
||||||
#CONFIG += version_detail_bash_script
|
#CONFIG += version_detail_bash_script
|
||||||
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
QMAKE_CXXFLAGS *= -D_FILE_OFFSET_BITS=64
|
||||||
@ -1399,44 +1439,3 @@ gxsgui {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cmark {
|
|
||||||
DEFINES *= USE_CMARK
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
../../supportlibs/cmark/src/buffer.h \
|
|
||||||
../../supportlibs/cmark/src/chunk.h \
|
|
||||||
../../supportlibs/cmark/src/cmark.h \
|
|
||||||
../../supportlibs/cmark/src/cmark_ctype.h \
|
|
||||||
../../supportlibs/cmark/src/houdini.h \
|
|
||||||
../../supportlibs/cmark/src/inlines.h \
|
|
||||||
../../supportlibs/cmark/src/iterator.h \
|
|
||||||
../../supportlibs/cmark/src/node.h \
|
|
||||||
../../supportlibs/cmark/src/parser.h \
|
|
||||||
../../supportlibs/cmark/src/references.h \
|
|
||||||
../../supportlibs/cmark/src/render.h \
|
|
||||||
../../supportlibs/cmark/src/scanners.h \
|
|
||||||
../../supportlibs/cmark/src/utf8.h \
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
../../supportlibs/cmark/src/blocks.c \
|
|
||||||
../../supportlibs/cmark/src/buffer.c \
|
|
||||||
../../supportlibs/cmark/src/cmark.c \
|
|
||||||
../../supportlibs/cmark/src/cmark_ctype.c \
|
|
||||||
../../supportlibs/cmark/src/commonmark.c \
|
|
||||||
../../supportlibs/cmark/src/houdini_href_e.c \
|
|
||||||
../../supportlibs/cmark/src/houdini_html_e.c \
|
|
||||||
../../supportlibs/cmark/src/houdini_html_u.c \
|
|
||||||
../../supportlibs/cmark/src/html.c \
|
|
||||||
../../supportlibs/cmark/src/inlines.c \
|
|
||||||
../../supportlibs/cmark/src/iterator.c \
|
|
||||||
../../supportlibs/cmark/src/latex.c \
|
|
||||||
../../supportlibs/cmark/src/man.c \
|
|
||||||
../../supportlibs/cmark/src/node.c \
|
|
||||||
../../supportlibs/cmark/src/references.c \
|
|
||||||
../../supportlibs/cmark/src/render.c \
|
|
||||||
../../supportlibs/cmark/src/scanners.c \
|
|
||||||
../../supportlibs/cmark/src/utf8.c \
|
|
||||||
../../supportlibs/cmark/src/xml.c \
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -35,9 +35,7 @@
|
|||||||
|
|
||||||
#ifdef USE_CMARK
|
#ifdef USE_CMARK
|
||||||
//Include for CMark
|
//Include for CMark
|
||||||
// This needs to be fixed: use system library if available, etc.
|
#include <cmark.h>
|
||||||
#include <gui/../../../supportlibs/cmark/src/cmark.h>
|
|
||||||
#include <gui/../../../supportlibs/cmark/src/node.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -593,7 +591,7 @@ QString RsHtml::formatText(QTextDocument *textDocument, const QString &text, ulo
|
|||||||
// Parse CommonMark
|
// Parse CommonMark
|
||||||
int options = CMARK_OPT_DEFAULT;
|
int options = CMARK_OPT_DEFAULT;
|
||||||
cmark_parser *parser = cmark_parser_new(options);
|
cmark_parser *parser = cmark_parser_new(options);
|
||||||
cmark_parser_feed(parser, formattedText.toStdString().c_str(),formattedText.length());
|
cmark_parser_feed(parser, formattedText.toStdString().c_str(),static_cast<size_t>(formattedText.length()));
|
||||||
cmark_node *document = cmark_parser_finish(parser);
|
cmark_node *document = cmark_parser_finish(parser);
|
||||||
cmark_parser_free(parser);
|
cmark_parser_free(parser);
|
||||||
char *result;
|
char *result;
|
||||||
@ -601,7 +599,6 @@ QString RsHtml::formatText(QTextDocument *textDocument, const QString &text, ulo
|
|||||||
// Get result as html
|
// Get result as html
|
||||||
formattedText = QString::fromUtf8(result);
|
formattedText = QString::fromUtf8(result);
|
||||||
//Clean
|
//Clean
|
||||||
cmark_node_mem(document)->free(result);
|
|
||||||
cmark_node_free(document);
|
cmark_node_free(document);
|
||||||
//Get document formed HTML
|
//Get document formed HTML
|
||||||
textBrowser.setHtml(formattedText);
|
textBrowser.setHtml(formattedText);
|
||||||
|
@ -38,8 +38,8 @@ no_retroshare_nogui:CONFIG -= retroshare_nogui
|
|||||||
|
|
||||||
# To disable cmark append the following
|
# To disable cmark append the following
|
||||||
# assignation to qmake command line "CONFIG+=no_cmark"
|
# assignation to qmake command line "CONFIG+=no_cmark"
|
||||||
CONFIG *= no_cmark
|
CONFIG *= rs_gui_cmark
|
||||||
cmark:CONFIG -= no_cmark
|
no_rs_gui_cmark:CONFIG -= rs_gui_cmark
|
||||||
|
|
||||||
# To enable RetroShare plugins append the following
|
# To enable RetroShare plugins append the following
|
||||||
# assignation to qmake command line "CONFIG+=retroshare_plugins"
|
# assignation to qmake command line "CONFIG+=retroshare_plugins"
|
||||||
|
Loading…
Reference in New Issue
Block a user