[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / bindings / CMakeLists.txt
blobbec694e43bd7bea068e88e728bd848acf90761ae
1 file(GLOB SWIG_INTERFACES interface/*.i)
2 file(GLOB_RECURSE SWIG_SOURCES *.swig)
3 file(GLOB SWIG_HEADERS
4   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
5   ${LLDB_SOURCE_DIR}/include/lldb/*.h
6   ${LLDB_BINARY_DIR}/include/lldb/API/SBLanguages.h
8 file(GLOB SWIG_PRIVATE_HEADERS
9   ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h
11 foreach(private_header ${SWIG_PRIVATE_HEADERS})
12   list(REMOVE_ITEM SWIG_HEADERS ${private_header})
13 endforeach()
15 if(LLDB_BUILD_FRAMEWORK)
16   set(framework_arg --framework --target-platform Darwin)
17 endif()
19 if(APPLE)
20   set(DARWIN_EXTRAS "-D__APPLE__")
21 else()
22   set(DARWIN_EXTRAS "")
23 endif()
25 set(SWIG_COMMON_FLAGS
26   -c++
27   # Ignored warnings:
28   # 361: operator! ignored.
29   # 362: operator= ignored.
30   # 509: Overloaded method declaration effectively ignored, shadowed by previous declaration.
31   -w361,362,509
32   -features autodoc
33   -I${LLDB_SOURCE_DIR}/include
34   -I${LLDB_BINARY_DIR}/include
35   -I${CMAKE_CURRENT_SOURCE_DIR}
36   ${DARWIN_EXTRAS}
39 function(create_relative_symlink swig_target dest_file output_dir output_name)
40   get_filename_component(dest_file ${dest_file} ABSOLUTE)
41   get_filename_component(output_dir ${output_dir} ABSOLUTE)
42   file(RELATIVE_PATH rel_dest_file ${output_dir} ${dest_file})
43   if(CMAKE_HOST_UNIX)
44     set(LLVM_LINK_OR_COPY create_symlink)
45   else()
46     set(LLVM_LINK_OR_COPY copy)
47   endif()
48   add_custom_command(TARGET ${swig_target} POST_BUILD VERBATIM
49     COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} ${rel_dest_file} ${output_name}
50     WORKING_DIRECTORY ${output_dir})
51 endfunction()
53 if (LLDB_ENABLE_PYTHON)
54   add_subdirectory(python)
55 endif()
57 if (LLDB_ENABLE_LUA)
58   add_subdirectory(lua)
59 endif()