1# The debugserver build needs to conditionally include files depending on the 2# target architecture. 3# 4# Switch on the architecture specified by TARGET_TRIPLE, as 5# the llvm and swift build systems use this variable to identify the 6# target (through LLVM_HOST_TRIPLE). 7# 8# It would be possible to switch on CMAKE_OSX_ARCHITECTURES, but the swift 9# build does not provide it, preferring instead to pass arch-specific 10# CFLAGS etc explicitly. Switching on LLVM_HOST_TRIPLE is also an option, 11# but it breaks down when cross-compiling. 12 13if(TARGET_TRIPLE) 14 string(REGEX MATCH "^[^-]*" LLDB_DEBUGSERVER_ARCH ${TARGET_TRIPLE}) 15else() 16 set(LLDB_DEBUGSERVER_ARCH ${CMAKE_OSX_ARCHITECTURES}) 17endif() 18 19if("${LLDB_DEBUGSERVER_ARCH}" MATCHES ".*arm.*") 20 list(APPEND SOURCES arm/DNBArchImpl.cpp arm64/DNBArchImplARM64.cpp) 21 include_directories(${CURRENT_SOURCE_DIR}/arm ${CURRENT_SOURCE_DIR}/arm64) 22endif() 23 24if(NOT LLDB_DEBUGSERVER_ARCH OR "${LLDB_DEBUGSERVER_ARCH}" MATCHES ".*86.*") 25 list(APPEND SOURCES i386/DNBArchImplI386.cpp x86_64/DNBArchImplX86_64.cpp) 26 include_directories(${CURRENT_SOURCE_DIR}/i386 ${CURRENT_SOURCE_DIR}/x86_64) 27endif() 28 29add_subdirectory(DarwinLog) 30 31include_directories(..) 32 33include_directories(${LLDB_SOURCE_DIR}/tools/debugserver/source) 34add_library(lldbDebugserverArchSupport 35 ${SOURCES} 36 ) 37 38set_target_properties(lldbDebugserverArchSupport PROPERTIES FOLDER "lldb libraries/debugserver") 39