summaryrefslogtreecommitdiff
path: root/unittests/VMCore
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-06-21 09:51:26 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-06-21 09:51:26 +0000
commit7c888eee47a5ba925ddc91c837302a7c2a435e5c (patch)
treebac47cfa5fed2f636a55853b7586f4154616a030 /unittests/VMCore
parent7060221ae256ded2b7bbfec60a2c9bdc71426ff2 (diff)
Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/VMCore')
-rw-r--r--unittests/VMCore/CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/unittests/VMCore/CMakeLists.txt b/unittests/VMCore/CMakeLists.txt
new file mode 100644
index 0000000000..04eabf0b9e
--- /dev/null
+++ b/unittests/VMCore/CMakeLists.txt
@@ -0,0 +1,27 @@
+set(LLVM_LINK_COMPONENTS
+ asmparser
+ analysis
+ core
+ ipa
+ target
+ )
+
+set(VMCoreSources
+ ConstantsTest.cpp
+ DominatorTreeTest.cpp
+ InstructionsTest.cpp
+ MetadataTest.cpp
+ PassManagerTest.cpp
+ ValueMapTest.cpp
+ VerifierTest.cpp
+ )
+
+# MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug.
+# See issue#331418 in Visual Studio.
+if(MSVC AND MSVC_VERSION LESS 1600)
+ list(REMOVE_ITEM VMCoreSources ValueMapTest.cpp)
+endif()
+
+add_llvm_unittest(VMCoreTests
+ ${VMCoreSources}
+ )