1if ( CMAKE_SYSTEM_NAME MATCHES "Windows" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD" ) 2 add_definitions( -DIMPORT_LIBLLDB ) 3 list(APPEND extra_libs lldbHost) 4endif () 5 6if (HAVE_LIBPTHREAD) 7 list(APPEND extra_libs pthread) 8endif () 9 10 11if(APPLE) 12 configure_file( 13 ${CMAKE_CURRENT_SOURCE_DIR}/lldb-vscode-Info.plist.in 14 ${CMAKE_CURRENT_BINARY_DIR}/lldb-vscode-Info.plist 15 ) 16 # Inline info plist in binary (use target_link_options for this as soon as CMake 3.13 is available) 17 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/lldb-vscode-Info.plist") 18endif() 19 20# We need to include the llvm components we depend on manually, as liblldb does 21# not re-export those. 22set(LLVM_LINK_COMPONENTS Support) 23set(LLVM_TARGET_DEFINITIONS Options.td) 24tablegen(LLVM Options.inc -gen-opt-parser-defs) 25add_public_tablegen_target(LLDBVSCodeOptionsTableGen) 26add_lldb_tool(lldb-vscode 27 lldb-vscode.cpp 28 BreakpointBase.cpp 29 ExceptionBreakpoint.cpp 30 FifoFiles.cpp 31 FunctionBreakpoint.cpp 32 IOStream.cpp 33 JSONUtils.cpp 34 LLDBUtils.cpp 35 OutputRedirector.cpp 36 ProgressEvent.cpp 37 RunInTerminal.cpp 38 SourceBreakpoint.cpp 39 VSCode.cpp 40 41 LINK_LIBS 42 liblldb 43 ${host_lib} 44 ${extra_libs} 45 46 LINK_COMPONENTS 47 Option 48 Support 49 ) 50 51if(LLDB_BUILD_FRAMEWORK) 52 # In the build-tree, we know the exact path to the framework directory. 53 # The installed framework can be in different locations. 54 lldb_setup_rpaths(lldb-vscode 55 BUILD_RPATH 56 "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}" 57 INSTALL_RPATH 58 "@loader_path/../../../SharedFrameworks" 59 "@loader_path/../../System/Library/PrivateFrameworks" 60 "@loader_path/../../Library/PrivateFrameworks" 61 ) 62endif() 63