mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
mac worked version
This commit is contained in:
@ -40,11 +40,6 @@ HEADERS += doctrenderer.h \
|
||||
memorystream.h \
|
||||
nativecontrol.h
|
||||
|
||||
unix {
|
||||
target.path = /usr/lib
|
||||
INSTALLS += target
|
||||
}
|
||||
|
||||
# downloader
|
||||
DEFINES += BUIDLER_OPEN_DOWNLOAD_ENABLED
|
||||
DEFINES += BUIDLER_OPEN_BASE64_ENABLED
|
||||
|
||||
@ -468,26 +468,6 @@ v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplate(v8::Isolate* isolate)
|
||||
v8::Handle<v8::ObjectTemplate> CreateNativeControlTemplateBuilder(v8::Isolate* isolate);
|
||||
// --------------------------
|
||||
|
||||
// create work with arraytypes
|
||||
class MallocArrayBufferAllocator : public v8::ArrayBuffer::Allocator
|
||||
{
|
||||
public:
|
||||
virtual void* Allocate(size_t length)
|
||||
{
|
||||
void* ret = malloc(length);
|
||||
memset(ret, 0, length);
|
||||
return ret;
|
||||
}
|
||||
virtual void* AllocateUninitialized(size_t length)
|
||||
{
|
||||
return malloc(length);
|
||||
}
|
||||
virtual void Free(void* data, size_t length)
|
||||
{
|
||||
free(data);
|
||||
}
|
||||
};
|
||||
|
||||
class CChangesWorker
|
||||
{
|
||||
private:
|
||||
@ -1061,42 +1041,39 @@ class CV8Initializer
|
||||
{
|
||||
private:
|
||||
v8::Platform* m_platform;
|
||||
MallocArrayBufferAllocator m_oAllocator;
|
||||
v8::ArrayBuffer::Allocator* m_pAllocator;
|
||||
|
||||
public:
|
||||
CV8Initializer() : m_oAllocator()
|
||||
CV8Initializer()
|
||||
{
|
||||
std::wstring sPrW = NSFile::GetProcessPath();
|
||||
std::string sPrA = U_TO_UTF8(sPrW);
|
||||
|
||||
v8::V8::InitializeICUDefaultLocation(sPrA.c_str());
|
||||
v8::V8::InitializeExternalStartupData(sPrA.c_str());
|
||||
m_platform = v8::platform::CreateDefaultPlatform();
|
||||
v8::V8::InitializePlatform(m_platform);
|
||||
|
||||
v8::V8::Initialize();
|
||||
v8::V8::InitializeICU();
|
||||
|
||||
#ifndef NEW_V8_ENGINE
|
||||
v8::V8::SetArrayBufferAllocator(&m_oAllocator);
|
||||
#endif
|
||||
}
|
||||
~CV8Initializer()
|
||||
{
|
||||
v8::V8::Dispose();
|
||||
v8::V8::ShutdownPlatform();
|
||||
delete m_platform;
|
||||
delete m_pAllocator;
|
||||
}
|
||||
|
||||
v8::ArrayBuffer::Allocator* getAllocator()
|
||||
{
|
||||
return &m_oAllocator;
|
||||
return m_pAllocator;
|
||||
}
|
||||
|
||||
v8::Isolate* CreateNew()
|
||||
{
|
||||
#ifdef NEW_V8_ENGINE
|
||||
v8::Isolate::CreateParams create_params;
|
||||
create_params.array_buffer_allocator = &m_oAllocator;
|
||||
m_pAllocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
|
||||
create_params.array_buffer_allocator = m_pAllocator;
|
||||
return v8::Isolate::New(create_params);
|
||||
#else
|
||||
return v8::Isolate::New();
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -14,41 +14,13 @@ CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
############### destination path ###############
|
||||
DESTINATION_SDK_PATH = $$PWD/../../../build/lib
|
||||
|
||||
# WINDOWS
|
||||
win32:contains(QMAKE_TARGET.arch, x86_64):{
|
||||
CONFIG(debug, debug|release) {
|
||||
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_64/DEBUG
|
||||
} else {
|
||||
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_64
|
||||
}
|
||||
}
|
||||
win32:!contains(QMAKE_TARGET.arch, x86_64):{
|
||||
CONFIG(debug, debug|release) {
|
||||
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_32/DEBUG
|
||||
} else {
|
||||
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/win_32
|
||||
}
|
||||
}
|
||||
|
||||
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
|
||||
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/linux_64
|
||||
}
|
||||
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
|
||||
DESTINATION_SDK_PATH_DOCTRENDERER = $$DESTINATION_SDK_PATH/linux_32
|
||||
}
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
DESTDIR = $$PWD/Debug
|
||||
} else {
|
||||
DESTDIR = $$PWD/Release
|
||||
}
|
||||
CORE_ROOT_DIR = $$PWD/../../../
|
||||
PWD_ROOT_DIR = $$PWD
|
||||
include(../../../Common/base.pri)
|
||||
|
||||
################################################
|
||||
|
||||
LIBS += -L$$DESTINATION_SDK_PATH_DOCTRENDERER -ldoctrenderer
|
||||
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -ldoctrenderer
|
||||
|
||||
linux-g++ {
|
||||
LIBS += -ldl
|
||||
|
||||
Reference in New Issue
Block a user