我正在研究 chromium for android 的源代码:尝试在 Webkit 中开发一些功能。
我做了什么:(1)在“third_party/WebKit/Source/core/frame”中创建test.cpp/test.h:test.cpp包含addlib.h调用addlib.so中的求和函数(下一步创建) (2)通过“g++ -fPIC -shared addlib.cpp -o addlib.so”在“third_party/WebKit/Source/core/frame”中创建add.h和add.so(addlib.so只提供求和的功能两个整数并返回结果)
blink_core_sources("frame") {
sources = [
"BarProp.cpp",
"BarProp.h",
"BrowserControls.cpp",
"BrowserControls.h",
"ContentSettingsClient.cpp",
.........
"csp/ContentSecurityPolicy.cpp",
"csp/ContentSecurityPolicy.h",
"csp/MediaListDirective.cpp",
"csp/MediaListDirective.h",
"csp/SourceListDirective.cpp",
"csp/SourceListDirective.h",
// my modification
"test.h",
"test.cpp",
"addlib.h"
]
// my modification
shared_library = [ ":addlib.so" ]
}
我的目的:在test.cpp中调用addlib.so中的函数
但是 gn 给了我错误信息:
ERROR at //third_party/WebKit/Source/core/frame/BUILD.gn:170:20:Assignment had no effect.
shared_library = [ ":addlib.so" ]
^-----------
You set the variable "shared_library" here and it was unused before it went out of scope.
对我有什么建议吗?非常感谢。