2

I'm working on the source code of chromium for android: trying to develop some features in Webkit.

What I've done: (1)Create test.cpp/test.h in "third_party/WebKit/Source/core/frame": test.cpp includes addlib.h calls the summation function in addlib.so(create in next step) (2)Create add.h and add.so in "third_party/WebKit/Source/core/frame" by "g++ -fPIC -shared addlib.cpp -o addlib.so" (addlib.so only provides the function of summation two integer and returns the result)

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" ]
}

My purpose: Call the function in addlib.so in test.cpp

But the gn give me the error message:

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.

Is there any advise for me? many thanks.

hsnu_976
  • 71
  • 1
  • 5

0 Answers0