如何添加参数-fvisibility = default到CMAKE?

时间:2019-02-14 06:45:34

标签: c++ qt cmake qtwebkit

我需要从qtwebkit获取隐藏的API WebCore。

例如

    QWebPage *page = mainWidget->page();    
    QWebFrame *qtWebFrame = mainWidget->page()->mainFrame();
    QWebFramePrivate *qtWebFramePrivate = qtWebFrame->d;
    WebCore::Frame *frame = qtWebFramePrivate->frame;

    WebCore::DocumentWriter m_writer(frame);
    m_writer.setFrame(frame);
    m_writer.begin(url, false);
    m_writer.setDocumentWasLoadedAsPartOfNavigation();
    m_writer.setEncoding("utf-8", true);    
    m_writer.addData(html ,strlen(html) );
    m_writer.end();

如何导出此私有WebCore?

1 个答案:

答案 0 :(得分:0)

您必须在目标上设置正确的属性:

add_executable(MyTarget ...)

set_target_properties(MyTarget PROPERTIES CXX_VISIBILITY_PRESET default)