[llvm] 549a1e2 - Renovate CMake files in the `llvm-exegesis` tool.
Jameson Nash via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 8 15:27:36 PST 2021
Author: Jameson Nash
Date: 2021-02-08T18:06:07-05:00
New Revision: 549a1e2e59508d4aeaf9a93912b479798954bd5e
URL: https://github.com/llvm/llvm-project/commit/549a1e2e59508d4aeaf9a93912b479798954bd5e
DIFF: https://github.com/llvm/llvm-project/commit/549a1e2e59508d4aeaf9a93912b479798954bd5e.diff
LOG: Renovate CMake files in the `llvm-exegesis` tool.
This attempts to move all tools over to using `add_llvm_library` for
better consistency. After doing this, I noticed it ended up as nearly a
reimplementation of https://reviews.llvm.org/rL342148, which later got
reverted in r342336 (b09a8c9bd9b819741b38071a7ccd95042ef2643a).
With ccache and ninja on a large core machine (40), I haven't run into
build errors, so I'm hopeful it's better now, though it doesn't seem to
be any different / new.
Reviewed By: stephenneuendorffer
Differential Revision: https://reviews.llvm.org/D90970
Added:
Modified:
llvm/tools/llvm-exegesis/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
llvm/utils/TableGen/GlobalISel/CMakeLists.txt
Removed:
################################################################################
diff --git a/llvm/tools/llvm-exegesis/CMakeLists.txt b/llvm/tools/llvm-exegesis/CMakeLists.txt
index 0575f2a06bb7..f1e17844c486 100644
--- a/llvm/tools/llvm-exegesis/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS
+ MC
MCParser
Support
native
@@ -7,6 +8,9 @@ set(LLVM_LINK_COMPONENTS
add_llvm_tool(llvm-exegesis
DISABLE_LLVM_LINK_LLVM_DYLIB
llvm-exegesis.cpp
+
+ DEPENDS
+ intrinsics_gen
)
add_subdirectory(lib)
diff --git a/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
index a251b8ff683e..bac77efb6c8f 100644
--- a/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt
@@ -3,16 +3,17 @@ include_directories(
${LLVM_BINARY_DIR}/lib/Target/AArch64
)
-add_library(LLVMExegesisAArch64
- STATIC
- Target.cpp
- )
-
-llvm_update_compile_flags(LLVMExegesisAArch64)
-llvm_map_components_to_libnames(libs
+set(LLVM_LINK_COMPONENTS
AArch64
Exegesis
+ Core
)
-target_link_libraries(LLVMExegesisAArch64 ${libs})
-set_target_properties(LLVMExegesisAArch64 PROPERTIES FOLDER "Libraries")
+add_llvm_library(LLVMExegesisAArch64
+ DISABLE_LLVM_LINK_LLVM_DYLIB
+ STATIC
+ Target.cpp
+
+ DEPENDS
+ intrinsics_gen
+ )
diff --git a/llvm/tools/llvm-exegesis/lib/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/CMakeLists.txt
index 48896d4a1b36..2ca0ce4f905a 100644
--- a/llvm/tools/llvm-exegesis/lib/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/CMakeLists.txt
@@ -19,7 +19,29 @@ endif()
set(LLVM_EXEGESIS_TARGETS "${LLVM_EXEGESIS_TARGETS} ${TARGETS_TO_APPEND}" PARENT_SCOPE)
-add_library(LLVMExegesis
+set(LLVM_LINK_COMPONENTS
+ Analysis
+ CodeGen
+ Core
+ ExecutionEngine
+ GlobalISel
+ MC
+ MCDisassembler
+ MCJIT
+ MCParser
+ Object
+ ObjectYAML
+ RuntimeDyld
+ Support
+ )
+
+set(libs)
+if(LLVM_ENABLE_LIBPFM AND HAVE_LIBPFM)
+ list(APPEND libs pfm)
+endif()
+
+add_llvm_library(LLVMExegesis
+ DISABLE_LLVM_LINK_LLVM_DYLIB
STATIC
Analysis.cpp
Assembler.cpp
@@ -42,28 +64,9 @@ add_library(LLVMExegesis
SnippetRepetitor.cpp
Target.cpp
UopsBenchmarkRunner.cpp
- )
-llvm_update_compile_flags(LLVMExegesis)
-llvm_map_components_to_libnames(libs
- Analysis
- CodeGen
- Core
- ExecutionEngine
- GlobalISel
- MC
- MCDisassembler
- MCJIT
- MCParser
- Object
- ObjectYAML
- RuntimeDyld
- Support
- )
+ LINK_LIBS ${libs}
-if(LLVM_ENABLE_LIBPFM AND HAVE_LIBPFM)
- list(APPEND libs pfm)
-endif()
-
-target_link_libraries(LLVMExegesis ${libs})
-set_target_properties(LLVMExegesis PROPERTIES FOLDER "Libraries")
+ DEPENDS
+ intrinsics_gen
+ )
diff --git a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
index 79bd563a6207..5ff716ab421c 100644
--- a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt
@@ -3,16 +3,17 @@ include_directories(
${LLVM_BINARY_DIR}/lib/Target/Mips
)
-add_library(LLVMExegesisMips
- STATIC
- Target.cpp
- )
-
-llvm_update_compile_flags(LLVMExegesisMips)
-llvm_map_components_to_libnames(libs
+set(LLVM_LINK_COMPONENTS
Mips
Exegesis
+ Core
)
-target_link_libraries(LLVMExegesisMips ${libs})
-set_target_properties(LLVMExegesisMips PROPERTIES FOLDER "Libraries")
+add_llvm_library(LLVMExegesisMips
+ DISABLE_LLVM_LINK_LLVM_DYLIB
+ STATIC
+ Target.cpp
+
+ DEPENDS
+ intrinsics_gen
+ )
diff --git a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
index 89e33437952e..9d54d51b1840 100644
--- a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt
@@ -3,16 +3,17 @@ include_directories(
${LLVM_BINARY_DIR}/lib/Target/PowerPC
)
-add_library(LLVMExegesisPowerPC
- STATIC
- Target.cpp
- )
-
-llvm_update_compile_flags(LLVMExegesisPowerPC)
-llvm_map_components_to_libnames(libs
+set(LLVM_LINK_COMPONENTS
PowerPC
Exegesis
+ Core
)
-target_link_libraries(LLVMExegesisPowerPC ${libs})
-set_target_properties(LLVMExegesisPowerPC PROPERTIES FOLDER "Libraries")
+add_llvm_library(LLVMExegesisPowerPC
+ DISABLE_LLVM_LINK_LLVM_DYLIB
+ STATIC
+ Target.cpp
+
+ DEPENDS
+ intrinsics_gen
+ )
diff --git a/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
index ce3bbd5908a8..f8cada7d13da 100644
--- a/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
+++ b/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt
@@ -3,17 +3,18 @@ include_directories(
${LLVM_BINARY_DIR}/lib/Target/X86
)
-add_library(LLVMExegesisX86
+set(LLVM_LINK_COMPONENTS
+ X86
+ Exegesis
+ Core
+ )
+
+add_llvm_library(LLVMExegesisX86
+ DISABLE_LLVM_LINK_LLVM_DYLIB
STATIC
Target.cpp
X86Counter.cpp
- )
-llvm_update_compile_flags(LLVMExegesisX86)
-llvm_map_components_to_libnames(libs
- X86
- Exegesis
+ DEPENDS
+ intrinsics_gen
)
-
-target_link_libraries(LLVMExegesisX86 ${libs})
-set_target_properties(LLVMExegesisX86 PROPERTIES FOLDER "Libraries")
diff --git a/llvm/utils/TableGen/GlobalISel/CMakeLists.txt b/llvm/utils/TableGen/GlobalISel/CMakeLists.txt
index 25fff72d3dcf..c23ef6742f32 100644
--- a/llvm/utils/TableGen/GlobalISel/CMakeLists.txt
+++ b/llvm/utils/TableGen/GlobalISel/CMakeLists.txt
@@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS
TableGen
)
-llvm_add_library(LLVMTableGenGlobalISel STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
+add_llvm_library(LLVMTableGenGlobalISel STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
CodeExpander.cpp
GIMatchDag.cpp
GIMatchDagEdge.cpp
More information about the llvm-commits
mailing list