From 8a5c5a016cf07fa71dde21eb128256be7924f216 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Thu, 13 Mar 2014 21:16:13 +0000 Subject: [PATCH] Fix cmake build issues on Darwin. llvm-svn: 203850 --- lldb/source/CMakeLists.txt | 5 +++++ lldb/source/Plugins/JITLoader/CMakeLists.txt | 3 ++- lldb/source/Plugins/Process/CMakeLists.txt | 5 ++--- lldb/tools/debugserver/source/CMakeLists.txt | 2 ++ lldb/tools/debugserver/source/MacOSX/CMakeLists.txt | 6 ++++++ .../debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp | 1 + .../debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h | 1 - 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lldb/source/CMakeLists.txt b/lldb/source/CMakeLists.txt index 30835652589e..ec96a4b51e9a 100644 --- a/lldb/source/CMakeLists.txt +++ b/lldb/source/CMakeLists.txt @@ -135,6 +135,9 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) lldbPluginProcessMacOSXKernel lldbPluginSymbolVendorMacOSX lldbPluginSystemRuntimeMacOSX + lldbPluginProcessPOSIX + lldbPluginProcessElfCore + lldbPluginJITLoaderGDB ) endif() @@ -167,6 +170,8 @@ if (NOT LLDB_DISABLE_PYTHON) list(APPEND LLDB_SYSTEM_LIBS ${PYTHON_LIBRARIES}) endif() +list(APPEND LLDB_SYSTEM_LIBS ${system_libs}) + set( LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} jit diff --git a/lldb/source/Plugins/JITLoader/CMakeLists.txt b/lldb/source/Plugins/JITLoader/CMakeLists.txt index 7bd733c3b56a..f6f72c32e2ce 100644 --- a/lldb/source/Plugins/JITLoader/CMakeLists.txt +++ b/lldb/source/Plugins/JITLoader/CMakeLists.txt @@ -1,3 +1,4 @@ -if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Windows") +if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "Linux" + OR CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "Darwin") add_subdirectory(GDB) endif() diff --git a/lldb/source/Plugins/Process/CMakeLists.txt b/lldb/source/Plugins/Process/CMakeLists.txt index f9bdf79282b0..8937fb4af386 100644 --- a/lldb/source/Plugins/Process/CMakeLists.txt +++ b/lldb/source/Plugins/Process/CMakeLists.txt @@ -1,16 +1,15 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") add_subdirectory(Linux) add_subdirectory(POSIX) - add_subdirectory(elf-core) elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_subdirectory(FreeBSD) add_subdirectory(POSIX) - add_subdirectory(elf-core) elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") - add_subdirectory(elf-core) elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") + add_subdirectory(POSIX) add_subdirectory(MacOSX-Kernel) endif() add_subdirectory(gdb-remote) add_subdirectory(Utility) add_subdirectory(mach-core) +add_subdirectory(elf-core) diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt index d9b4fea657f1..05d698315675 100644 --- a/lldb/tools/debugserver/source/CMakeLists.txt +++ b/lldb/tools/debugserver/source/CMakeLists.txt @@ -40,6 +40,8 @@ add_library(lldbDebugserverCommon add_dependencies(lldbDebugserverCommon generate_dnbconfig) if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + find_library(COCOA_LIBRARY Cocoa) + target_link_libraries(lldbDebugserverCommon ${COCOA_LIBRARY}) add_subdirectory(MacOSX) endif() diff --git a/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt b/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt index b955917e2e32..8e2ec1c66e48 100644 --- a/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt +++ b/lldb/tools/debugserver/source/MacOSX/CMakeLists.txt @@ -40,6 +40,12 @@ add_lldb_executable(debugserver ${generated_mach_interfaces} ) +set_source_files_properties( + HasAVX.s + # Necessary since compilation will fail with stand-alone assembler + PROPERTIES LANGUAGE C COMPILE_FLAGS "-x assembler-with-cpp" + ) + add_dependencies(debugserver generate_dnbconfig) target_link_libraries(debugserver ${DEBUGSERVER_USED_LIBS}) diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp index e2d39311a663..f683635d926c 100644 --- a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp +++ b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp @@ -18,6 +18,7 @@ #include #include "MacOSX/x86_64/DNBArchImplX86_64.h" +#include "../HasAVX.h" #include "DNBLog.h" #include "MachThread.h" #include "MachProcess.h" diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h index ac171ee76424..e9ba50f7ab6e 100644 --- a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h +++ b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h @@ -16,7 +16,6 @@ #if defined (__i386__) || defined (__x86_64__) #include "DNBArch.h" -#include "../HasAVX.h" #include "MachRegisterStatesX86_64.h" #include