Create an fxjs static library

This CL moves the fxjs/ code out of the xfa library and into a fxjs library.

Review-Url: https://codereview.chromium.org/2136273002
diff --git a/BUILD.gn b/BUILD.gn
index 2771377..96df81c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -870,6 +870,35 @@
 }
 
 if (pdf_enable_xfa) {
+  static_library("fxjs") {
+    sources = [
+      "fxjs/cfxjse_arguments.cpp",
+      "fxjs/cfxjse_class.cpp",
+      "fxjs/cfxjse_context.cpp",
+      "fxjs/cfxjse_isolatetracker.cpp",
+      "fxjs/cfxjse_isolatetracker.h",
+      "fxjs/cfxjse_runtimedata.cpp",
+      "fxjs/cfxjse_runtimedata.h",
+      "fxjs/cfxjse_value.cpp",
+      "fxjs/include/cfxjse_arguments.h",
+      "fxjs/include/cfxjse_class.h",
+      "fxjs/include/cfxjse_context.h",
+      "fxjs/include/cfxjse_value.h",
+      "fxjs/include/fxjse.h",
+    ]
+    deps = [
+        "//v8:v8_libplatform",
+    ]
+    configs += [ ":pdfium_core_config" ]
+    include_dirs = [
+      "//v8",
+      "//v8/include",
+    ]
+    public_deps = [
+      "//v8",
+    ]
+  }
+
   static_library("fpdfxfa") {
     sources = [
       "fpdfsdk/fpdfxfa/fpdfxfa_app.cpp",
@@ -889,19 +918,6 @@
 
   static_library("xfa") {
     sources = [
-      "fxjs/cfxjse_arguments.cpp",
-      "fxjs/cfxjse_class.cpp",
-      "fxjs/cfxjse_context.cpp",
-      "fxjs/cfxjse_isolatetracker.cpp",
-      "fxjs/cfxjse_isolatetracker.h",
-      "fxjs/cfxjse_runtimedata.cpp",
-      "fxjs/cfxjse_runtimedata.h",
-      "fxjs/cfxjse_value.cpp",
-      "fxjs/include/cfxjse_arguments.h",
-      "fxjs/include/cfxjse_class.h",
-      "fxjs/include/cfxjse_context.h",
-      "fxjs/include/cfxjse_value.h",
-      "fxjs/include/fxjse.h",
       "xfa/fde/cfde_path.cpp",
       "xfa/fde/cfde_path.h",
       "xfa/fde/cfde_txtedtbuf.cpp",
@@ -1442,14 +1458,9 @@
     ]
     include_dirs = [
       ".",
-      "//v8",
-      "//v8/include",
-    ]
-    public_deps = [
-      "//v8",
     ]
     deps = [
-      "//v8:v8_libplatform",
+      ":fxjs",
     ]
     configs += [
       ":pdfium_core_config",
diff --git a/xfa.gyp b/xfa.gyp
index 92ae06a..d8c165e 100644
--- a/xfa.gyp
+++ b/xfa.gyp
@@ -16,27 +16,22 @@
   },
   "targets":[
     {
-      "target_name":"xfa",
-      "type":"static_library",
+      "target_name": "fxjs",
+      "type": "static_library",
       'include_dirs': [
         # This is implicit in GN.
         '<(DEPTH)',
         '.',
-        'third_party/freetype/include',
-        'third_party/freetype/include/freetype',
         '<(DEPTH)/v8',
         '<(DEPTH)/v8/include',
       ],
-      'defines' : [
-        'FT2_BUILD_LIBRARY',
-      ],
       'dependencies': [
         '<(DEPTH)/v8/src/v8.gyp:v8',
       ],
       'export_dependent_settings': [
         '<(DEPTH)/v8/src/v8.gyp:v8',
       ],
-      "sources":[
+      "sources": [
         "fxjs/cfxjse_arguments.cpp",
         "fxjs/cfxjse_class.cpp",
         "fxjs/cfxjse_context.cpp",
@@ -50,6 +45,25 @@
         "fxjs/include/cfxjse_context.h",
         "fxjs/include/cfxjse_value.h",
         "fxjs/include/fxjse.h",
+      ]
+    },
+    {
+      "target_name":"xfa",
+      "type":"static_library",
+      'include_dirs': [
+        # This is implicit in GN.
+        '<(DEPTH)',
+        '.',
+        'third_party/freetype/include',
+        'third_party/freetype/include/freetype',
+      ],
+      'defines' : [
+        'FT2_BUILD_LIBRARY',
+      ],
+      'dependencies': [
+        ':fxjs',
+      ],
+      "sources":[
         "xfa/fde/cfde_path.cpp",
         "xfa/fde/cfde_path.h",
         "xfa/fde/cfde_txtedtbuf.cpp",