[llvm] 012412d - [gn build] (manually) port 97579dcc6d3 (LLVMMCATests)
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 24 18:03:06 PDT 2022
Author: Nico Weber
Date: 2022-06-24T21:02:35-04:00
New Revision: 012412d19267bacf4b06ad412bcaf5c3d4ded397
URL: https://github.com/llvm/llvm-project/commit/012412d19267bacf4b06ad412bcaf5c3d4ded397
DIFF: https://github.com/llvm/llvm-project/commit/012412d19267bacf4b06ad412bcaf5c3d4ded397.diff
LOG: [gn build] (manually) port 97579dcc6d3 (LLVMMCATests)
The CMake code makes a number of imho strange choices. I pointed those
out on https://reviews.llvm.org/D127083.
The GN build mirrors the CMake build's choices for now.
Added:
llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/BUILD.gn
llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/X86/BUILD.gn
Modified:
llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
Removed:
################################################################################
diff --git a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
index e11d9ecd1924c..49e6e957ec1c9 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/BUILD.gn
@@ -53,6 +53,7 @@ group("unittests") {
"tools/llvm-cfi-verify:CFIVerifyTests",
"tools/llvm-exegesis:LLVMExegesisTests",
"tools/llvm-profgen:LLVMProfgenTests",
+ "tools/llvm-mca:LLVMMCATests",
]
# Target-dependent unit tests.
diff --git a/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/BUILD.gn
new file mode 100644
index 0000000000000..800dcabe3e194
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/BUILD.gn
@@ -0,0 +1,25 @@
+import("//llvm/lib/Target/targets.gni")
+import("//llvm/utils/unittest/unittest.gni")
+
+unittest("LLVMMCATests") {
+ deps = [
+ "//llvm/lib/MC",
+ "//llvm/lib/MCA",
+ "//llvm/lib/Object",
+ "//llvm/lib/Support",
+ ]
+ if (llvm_build_X86) {
+ deps += [ "X86" ]
+ }
+
+ sources = [
+ "MCATestBase.cpp",
+ ]
+
+ # FIXME: Why is this so complicated in the cmake file?
+ mca_views_sources = [ "SummaryView.cpp" ]
+ foreach(s, mca_views_sources) {
+ sources += [ "//llvm/tools/llvm-mca/Views/" + s ]
+ }
+ include_dirs = [ "//llvm/tools/llvm-mca" ]
+}
diff --git a/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/X86/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/X86/BUILD.gn
new file mode 100644
index 0000000000000..f43473d33ecaa
--- /dev/null
+++ b/llvm/utils/gn/secondary/llvm/unittests/tools/llvm-mca/X86/BUILD.gn
@@ -0,0 +1,21 @@
+# source_set instead of static_library so that all test cpp files are loaded.
+source_set("X86") {
+ testonly = true
+ deps = [
+ "//llvm/lib/Target/X86",
+ "//llvm/utils/unittest:gtest",
+
+ # This test target reaches inside the Target/X86 tablegen internals and must
+ # depend on this Target/X86-internal build target.
+ "//llvm/lib/Target/X86/MCTargetDesc",
+ ]
+ include_dirs = [
+ "..",
+ "//llvm/lib/Target/X86",
+ "//llvm/tools/llvm-mca",
+ ]
+ sources = [
+ "TestIncrementalMCA.cpp",
+ "X86TestBase.cpp",
+ ]
+}
More information about the llvm-commits
mailing list