From 37f99a56065209627020428cecb78f55dfa90580 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 17 Dec 2020 13:54:59 +0100 Subject: [PATCH] [lldb] [unittests] Filter FreeBSD through CMake rather than #ifdef --- lldb/unittests/Process/Utility/CMakeLists.txt | 8 ++++++-- .../Process/Utility/RegisterContextFreeBSDTest.cpp | 4 ---- 2 files changed, 6 insertions(+), 6 deletions(-) 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 #include @@ -233,5 +231,3 @@ TEST(RegisterContextFreeBSDTest, i386) { } #endif // defined(__i386__) || defined(__x86_64__) - -#endif // defined(__FreeBSD__) -- 2.34.1