[llvm-branch-commits] [lldb] 37f99a5 - [lldb] [unittests] Filter FreeBSD through CMake rather than #ifdef

Michał Górny via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Dec 17 04:59:57 PST 2020


Author: Michał Górny
Date: 2020-12-17T13:55:42+01:00
New Revision: 37f99a56065209627020428cecb78f55dfa90580

URL: https://github.com/llvm/llvm-project/commit/37f99a56065209627020428cecb78f55dfa90580
DIFF: https://github.com/llvm/llvm-project/commit/37f99a56065209627020428cecb78f55dfa90580.diff

LOG: [lldb] [unittests] Filter FreeBSD through CMake rather than #ifdef

Added: 
    

Modified: 
    lldb/unittests/Process/Utility/CMakeLists.txt
    lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Process/Utility/CMakeLists.txt b/lldb/unittests/Process/Utility/CMakeLists.txt
index 8e4696b7211d..772e781b5cc5 100644
--- a/lldb/unittests/Process/Utility/CMakeLists.txt
+++ b/lldb/unittests/Process/Utility/CMakeLists.txt
@@ -1,17 +1,21 @@
+set(FREEBSD_SOURCES
+  RegisterContextFreeBSDTest.cpp)
 set(NETBSD_SOURCES
   RegisterContextNetBSDTest_i386.cpp
   RegisterContextNetBSDTest_x86_64.cpp)
 
-if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+  list(APPEND PLATFORM_SOURCES ${FREEBSD_SOURCES})
+elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   list(APPEND PLATFORM_SOURCES ${NETBSD_SOURCES})
 endif()
 
 set(LLVM_OPTIONAL_SOURCES
+  ${FREEBSD_SOURCES}
   ${NETBSD_SOURCES})
 
 add_lldb_unittest(ProcessUtilityTests
   RegisterContextTest.cpp
-  RegisterContextFreeBSDTest.cpp
   LinuxProcMapsTest.cpp
   ${PLATFORM_SOURCES}
 

diff  --git a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp b/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
index 7d875c9bd8a1..fe516d537662 100644
--- a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
@@ -6,8 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#if defined(__FreeBSD__)
-
 // clang-format off
 #include <sys/types.h>
 #include <machine/reg.h>
@@ -233,5 +231,3 @@ TEST(RegisterContextFreeBSDTest, i386) {
 }
 
 #endif // defined(__i386__) || defined(__x86_64__)
-
-#endif // defined(__FreeBSD__)


        


More information about the llvm-branch-commits mailing list