Move BUILD.gn files into submodules

Moving two files:
  driver/BUILD.gn -> driver/linux/BUILD.gn
  third_party/BUILD.gn -> third_party/googletest/BUILD.gn

GN sets $target_out_dir according to the location of the build file.
These two target therefore used to build inside the parent directory
rather than the directory corresponding to the location of their source
files. Moving them avoids potential conflict with other/future build
targets.

This is also useful because it eliminates the need to symlink these
files in repo-based builds.

Change-Id: Icc992c2e258e11afe39e2530afe198fa2d62905b
diff --git a/build/linux/linux.gni b/build/linux/linux.gni
index bb50aa6..f76b291 100644
--- a/build/linux/linux.gni
+++ b/build/linux/linux.gni
@@ -146,8 +146,10 @@
 
   source_target = "${target_name}__source"
 
+  module_dir = "./"
+
   source_dir_copy(source_target) {
-    path = invoker.module_dir
+    path = module_dir
   }
 
   action(target_name) {
diff --git a/driver/BUILD.gn b/driver/BUILD.gn
deleted file mode 100644
index a06996c..0000000
--- a/driver/BUILD.gn
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2019 The Hafnium Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-import("//build/linux/linux.gni")
-
-linux_kernel_module("linux") {
-  module_name = "hafnium"
-  module_dir = "./linux"
-  kernel_target = "//third_party/linux:linux"
-  kernel_dir = "//third_party/linux"
-}
diff --git a/driver/linux b/driver/linux
index 9abce27..81b9069 160000
--- a/driver/linux
+++ b/driver/linux
@@ -1 +1 @@
-Subproject commit 9abce277b3963472481d1068b98d502fe42d792c
+Subproject commit 81b90698b40fdcdd886e733a597ced435bd108b9
diff --git a/src/BUILD.gn b/src/BUILD.gn
index 5c9e56f..1437908 100644
--- a/src/BUILD.gn
+++ b/src/BUILD.gn
@@ -170,6 +170,6 @@
   ]
   deps = [
     ":src_testable",
-    "//third_party:gtest_main",
+    "//third_party/googletest:gtest_main",
   ]
 }
diff --git a/test/linux/BUILD.gn b/test/linux/BUILD.gn
index 681830e..0be5630 100644
--- a/test/linux/BUILD.gn
+++ b/test/linux/BUILD.gn
@@ -46,10 +46,10 @@
   test_binary_target = ":test_binary(//build/toolchain:aarch64_linux_clang)"
   sources = [
     get_label_info(test_binary_target, "root_out_dir") + "/test_binary",
-    get_label_info("//driver:linux", "target_out_dir") + "/hafnium.ko",
+    get_label_info("//driver/linux", "target_out_dir") + "/hafnium.ko",
   ]
   deps = [
-    "//driver:linux",
+    "//driver/linux",
     test_binary_target,
   ]
 }
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
deleted file mode 100644
index 43c7e41..0000000
--- a/third_party/BUILD.gn
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2018 The Hafnium Authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# TODO: Having all third_party targets defined in this file means they share
-# the same $target_out_dir folder. Ideally we would like to avoid that.
-
-config("gtest_config") {
-  visibility = [ ":gtest" ]
-
-  include_dirs = [
-    "googletest/googletest/include",
-    "googletest/googlemock/include",
-  ]
-
-  ldflags = [ "-pthread" ]
-}
-
-source_set("gtest") {
-  testonly = true
-
-  sources = [
-    "googletest/googlemock/src/gmock-all.cc",
-    "googletest/googletest/src/gtest-all.cc",
-  ]
-
-  include_dirs = [
-    "googletest/googletest",
-    "googletest/googlemock",
-  ]
-
-  all_dependent_configs = [ ":gtest_config" ]
-}
-
-source_set("gtest_main") {
-  testonly = true
-
-  sources = [
-    "googletest/googlemock/src/gmock_main.cc",
-  ]
-
-  deps = [
-    ":gtest",
-  ]
-}
diff --git a/third_party/googletest b/third_party/googletest
index ba669a9..90435b5 160000
--- a/third_party/googletest
+++ b/third_party/googletest
@@ -1 +1 @@
-Subproject commit ba669a95bb04a24f03c25321439a482e9b82e2aa
+Subproject commit 90435b5c42b2492a7105c56bd36505b190ce54be