Commit 59554c12 authored by Oleg Korshul's avatar Oleg Korshul Committed by Alexander Trofimov

переход на новую версию v8 (master)

parent 51f8d63e
1) install git:
windows:
http://msysgit.github.io/
linux:
sudo apt-get install git
2) create folder for work
example:
mkdir build_v8
cd build_v8
3)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
add PATH to depot_tools
linux/mac:
export PATH=`pwd`/depot_tools:"$PATH"
4)
gclient
windows:
add to PATH variable ...build_v8/depot_tools/python276_bin;
5)
. . fetch
set DEPOT_TOOLS_WIN_TOOLCHAIN=0
fetch v8
cd v8
6) build
linux:
CFLAGS="-fPIC" CXXFLAGS="-fPIC" make native
mac:
CFLAGS="-fPIC" CXXFLAGS="-fPIC -stdlib=libc++" LDFLAGS="-stdlib=libc++" make native
windows:
generate visual studio project
32bit: python build/gyp_v8
64bit: python build/gyp_v8 -Dtarget_arch=x64
build project in visual studio ( - , )
a) open all.sln
b) select projects:
icui18n
icuuc
mksnapshot
v8_base_0
v8_base_1
v8_base_2
v8_base_3
v8_libbase
v8_libplatform
v8_nosnapshot
v8_external_snapshot
) Project Properies -> Configuration Properties -> C/C++ ->Code Generation
for Debug Configuration change "Runtime Library" to "Multi-threaded Debug DLL (/MDd)"
for Release Configuration change "Runtime Library" to "Multi-threaded DLL(/MD)"
Rebuild All
7) Rebuild doctrenderer project
......@@ -1021,7 +1021,8 @@ namespace NSDoctRenderer
strScript += "\n\n";
}
strScript += m_pInternal->ReadScriptFile(sResourceFile);
//strScript += m_pInternal->ReadScriptFile(sResourceFile);
strScript += ("(function(){" + m_pInternal->ReadScriptFile(sResourceFile) + "})();");
if (m_pInternal->m_strEditorType == L"spreadsheet")
strScript += "\n$.ready();";
......
......@@ -58,17 +58,14 @@ static_link_libstd {
}
win32 {
V8_CHECKOUT_PATH = $$PWD/v8_windows/v8
V8_CHECKOUT_PATH = D:/GIT/v8/v8
}
linux-g++ | linux-g++-64 | linux-g++-32 {
V8_CHECKOUT_PATH = /home/oleg/v8
V8_CHECKOUT_PATH = /home/oleg/v8_build/v8
}
mac {
DEFINES += NEW_V8_ENGINE
#V8_CHECKOUT_PATH = /Users/Oleg/Desktop/GIT/v8_mac_work/v8
V8_CHECKOUT_PATH = /Users/Oleg/Desktop/GIT/v8_mac/v8
}
......@@ -100,6 +97,8 @@ INCLUDEPATH += \
$$V8_CHECKOUT_PATH \
$$V8_CHECKOUT_PATH/include
DEFINES += NEW_V8_ENGINE
#################### WINDOWS #####################
DESKTOPEDITOR_PATH = ..
include(../Qt_build/graphics/project/graphics_fonts.pri)
......@@ -113,10 +112,10 @@ include(../../OfficeUtils/OfficeUtils.pri)
win32:contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -lv8_base_0 -lv8_base_1 -lv8_base_2 -lv8_base_3 -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -licui18n -licuuc
} else {
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -lv8_base_0 -lv8_base_1 -lv8_base_2 -lv8_base_3 -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -licui18n -licuuc
}
......@@ -125,10 +124,10 @@ CONFIG(debug, debug|release) {
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -lv8_base_0 -lv8_base_1 -lv8_base_2 -lv8_base_3 -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Debug/lib -licui18n -licuuc
} else {
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -lv8_base_0 -lv8_base_1 -lv8_base_2 -lv8_base_3 -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/build/Release/lib -licui18n -licuuc
}
......@@ -144,7 +143,7 @@ linux-g++ | linux-g++-64 | linux-g++-32 {
_LINUX \
_LINUX_QT \
LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/tools/gyp -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/tools/gyp -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/out/native/obj.target/third_party/icu -licui18n -licuuc -licudata
}
......@@ -167,7 +166,6 @@ mac {
MAC \
QT_MAC
#LIBS += -L$$V8_CHECKOUT_PATH/out/native -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/out/native -lv8_base -lv8_libbase -lv8_libplatform -lv8_nosnapshot -lv8_external_snapshot
LIBS += -L$$V8_CHECKOUT_PATH/out/native -licui18n -licuuc -licudata
......
......@@ -376,21 +376,24 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplateBuilder(v8::Isolate* i
void CV8Worker::Initialize()
{
if (NULL == CV8Worker::m_pInitializer)
CV8Worker::m_pInitializer = new CV8Initializer();
if (NULL == m_pInitializer)
m_pInitializer = new CV8Initializer();
}
void CV8Worker::Dispose()
{
if (NULL != CV8Worker::m_pInitializer)
delete CV8Worker::m_pInitializer;
CV8Worker::m_pInitializer = NULL;
if (NULL != m_pInitializer)
delete m_pInitializer;
m_pInitializer = NULL;
}
CV8Initializer* CV8Worker::getInitializer()
{
if (NULL == CV8Worker::m_pInitializer)
CV8Worker::m_pInitializer = new CV8Initializer();
if (NULL == m_pInitializer)
{
m_pInitializer = new CV8Initializer();
}
return CV8Worker::m_pInitializer;
}
......
......@@ -5,6 +5,7 @@
#include <map>
#include "../fontengine/ApplicationFonts.h"
#include <iostream>
#include "../../graphics/Timer.h"
// string convert
std::wstring to_cstring(v8::Local<v8::Value> v);
......@@ -849,6 +850,29 @@ void CreateNativeObject(const v8::FunctionCallbackInfo<v8::Value>& args);
void CreateNativeObjectBuilder(const v8::FunctionCallbackInfo<v8::Value>& args);
void CreateNativeMemoryStream(const v8::FunctionCallbackInfo<v8::Value>& args);
#if 0
class CLoggerSpeed
{
public:
DWORD m_dwTime;
public:
CLoggerSpeed()
{
m_dwTime = NSTimers::GetTickCount();
}
void Lap(const std::string& details)
{
DWORD dwCur = NSTimers::GetTickCount();
FILE* f = fopen("D:\\doctrenderer.speed", "a+");
std::string sTmp = details + ": %d\n";
fprintf(f, sTmp.c_str(), (int)(dwCur - m_dwTime));
fclose(f);
m_dwTime = dwCur;
}
};
#endif
//////////////////////////////////////////////////////////////////////////////
class CV8Initializer
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment