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

llvm-svn: 252205
This commit is contained in:
Chaoren Lin 2015-11-05 20:45:29 +00:00
parent da7f428a4a
commit 2a7a94a655
3 changed files with 19 additions and 9 deletions

View File

@ -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();

View File

@ -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::WarnIfNoClassesCached ()
{
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::WarnIfNoClassesCached ()
m_noclasses_warning_emitted = true;
return;
}
#endif
Debugger &debugger(GetProcess()->GetTarget().GetDebugger());
if (debugger.GetAsyncOutputStream())

View File

@ -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})