[Lldb-commits] [lldb] r252205 - Completely avoid building Apple simulator on non-Darwin platforms.

Chaoren Lin via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 5 12:45:29 PST 2015


Author: chaoren
Date: Thu Nov  5 14:45:29 2015
New Revision: 252205

URL: http://llvm.org/viewvc/llvm-project?rev=252205&view=rev
Log:
Completely avoid building Apple simulator on non-Darwin platforms.

Summary:
This is a resubmission of r252179, but correctly ignores the source
files for other platforms.

Reviewers: granata.enrico, tberghammer, zturner, jingham

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D14389

Modified:
    lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=252205&r1=252204&r2=252205&view=diff
==============================================================================
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Thu Nov  5 14:45:29 2015
@@ -31,13 +31,13 @@
 #include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
 #include "Plugins/Platform/Kalimba/PlatformKalimba.h"
 #include "Plugins/Platform/Linux/PlatformLinux.h"
-#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
 #include "Plugins/Platform/MacOSX/PlatformMacOSX.h"
 #include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
 #include "Plugins/Platform/Windows/PlatformWindows.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
 
 #if defined(__APPLE__)
+#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
 #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
 #include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
@@ -130,9 +130,9 @@ SystemInitializerCommon::Initialize()
 
     PlatformRemoteiOS::Initialize();
     PlatformMacOSX::Initialize();
-    PlatformiOSSimulator::Initialize();
 
 #if defined(__APPLE__)
+    PlatformiOSSimulator::Initialize();
     DynamicLoaderDarwinKernel::Initialize();
     PlatformDarwinKernel::Initialize();
     ObjectFileMachO::Initialize();
@@ -168,7 +168,6 @@ SystemInitializerCommon::Terminate()
     ObjectContainerUniversalMachO::Terminate();
     PlatformMacOSX::Terminate();
     PlatformRemoteiOS::Terminate();
-    PlatformiOSSimulator::Terminate();
 
     ClangASTContext::Terminate();
     GoASTContext::Terminate();
@@ -178,6 +177,7 @@ SystemInitializerCommon::Terminate()
     EmulateInstructionMIPS64::Terminate();
 
 #if defined(__APPLE__)
+    PlatformiOSSimulator::Terminate();
     DynamicLoaderDarwinKernel::Terminate();
     ObjectFileMachO::Terminate();
     PlatformDarwinKernel::Terminate();

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=252205&r1=252204&r2=252205&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Thu Nov  5 14:45:29 2015
@@ -60,7 +60,9 @@
 #include "AppleObjCDeclVendor.h"
 #include "AppleObjCTrampolineHandler.h"
 
+#if defined(__APPLE__)
 #include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
+#endif
 
 using namespace lldb;
 using namespace lldb_private;
@@ -1765,7 +1767,8 @@ AppleObjCRuntimeV2::WarnIfNoClassesCache
 {
     if (m_noclasses_warning_emitted)
         return;
-    
+
+#if defined(__APPLE__)
     if (m_process &&
         m_process->GetTarget().GetPlatform() &&
         m_process->GetTarget().GetPlatform()->GetPluginName() == PlatformiOSSimulator::GetPluginNameStatic())
@@ -1775,7 +1778,8 @@ AppleObjCRuntimeV2::WarnIfNoClassesCache
         m_noclasses_warning_emitted = true;
         return;
     }
-    
+#endif
+
     Debugger &debugger(GetProcess()->GetTarget().GetDebugger());
     
     if (debugger.GetAsyncOutputStream())

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt?rev=252205&r1=252204&r2=252205&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/CMakeLists.txt Thu Nov  5 14:45:29 2015
@@ -1,16 +1,22 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
-  PlatformAppleSimulator.cpp
   PlatformDarwin.cpp
   PlatformDarwinKernel.cpp
-  PlatformiOSSimulator.cpp
   PlatformMacOSX.cpp
   PlatformRemoteiOS.cpp
   )
 
-if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
+list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
+  PlatformAppleSimulator.cpp
+  PlatformiOSSimulator.cpp
   PlatformiOSSimulatorCoreSimulatorSupport.mm
   )
+
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+  list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
+    ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
+else()
+  list(APPEND LLVM_OPTIONAL_SOURCES
+    ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 endif()
 
 add_lldb_library(lldbPluginPlatformMacOSX ${PLUGIN_PLATFORM_MACOSX_SOURCES})




More information about the lldb-commits mailing list