Index: llvm/trunk/utils/gn/build/libs/edit/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/build/libs/edit/BUILD.gn +++ llvm/trunk/utils/gn/build/libs/edit/BUILD.gn @@ -0,0 +1,12 @@ +import("//llvm/utils/gn/build/libs/edit/enable.gni") + +config("edit_config") { + visibility = [ ":edit" ] + libs = [ "edit" ] +} + +group("edit") { + if (llvm_enable_libedit) { + public_configs = [ ":edit_config" ] + } +} Index: llvm/trunk/utils/gn/build/libs/edit/enable.gni =================================================================== --- llvm/trunk/utils/gn/build/libs/edit/enable.gni +++ llvm/trunk/utils/gn/build/libs/edit/enable.gni @@ -0,0 +1,3 @@ +declare_args() { + llvm_enable_libedit = host_os == "mac" +} Index: llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ llvm/trunk/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -1,6 +1,7 @@ import("//llvm/lib/Target/targets.gni") import("//llvm/triples.gni") import("//llvm/utils/gn/build/buildflags.gni") +import("//llvm/utils/gn/build/libs/edit/enable.gni") import("//llvm/utils/gn/build/libs/pthread/enable.gni") import("//llvm/utils/gn/build/libs/terminfo/enable.gni") import("//llvm/utils/gn/build/libs/xar/enable.gni") @@ -178,7 +179,6 @@ "HAVE_CRASHREPORTER_INFO=1", "HAVE_DECL_ARC4RANDOM=1", "HAVE_DLADDR=1", - "HAVE_LIBEDIT=1", "HAVE_MALLOC_H=", "HAVE_MACH_MACH_H=1", "HAVE_MALLOC_MALLOC_H=1", @@ -190,7 +190,6 @@ "HAVE_CRASHREPORTER_INFO=", "HAVE_DECL_ARC4RANDOM=", "HAVE_DLADDR=", - "HAVE_LIBEDIT=", "HAVE_MACH_MACH_H=", "HAVE_MALLOC_H=1", "HAVE_MALLOC_MALLOC_H=", @@ -292,6 +291,12 @@ args += [ "LTDL_SHLIB_EXT=.dll" ] } + if (llvm_enable_libedit) { + args += [ "HAVE_LIBEDIT=1" ] + } else { + args += [ "HAVE_LIBEDIT=" ] + } + if (llvm_enable_libxar) { args += [ "HAVE_LIBXAR=1" ] } else { Index: llvm/trunk/utils/gn/secondary/llvm/lib/LineEditor/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/llvm/lib/LineEditor/BUILD.gn +++ llvm/trunk/utils/gn/secondary/llvm/lib/LineEditor/BUILD.gn @@ -0,0 +1,12 @@ +static_library("LineEditor") { + output_name = "LLVMLineEditor" + deps = [ + "//llvm/include/llvm/Config:config", + "//llvm/lib/Support", + "//llvm/utils/gn/build/libs/edit", + ] + + sources = [ + "LineEditor.cpp", + ] +} Index: llvm/trunk/utils/gn/secondary/llvm/lib/Testing/Support/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/llvm/lib/Testing/Support/BUILD.gn +++ llvm/trunk/utils/gn/secondary/llvm/lib/Testing/Support/BUILD.gn @@ -0,0 +1,12 @@ +static_library("Support") { + output_name = "LLVMTestingSupport" + deps = [ + "//llvm/lib/Support", + "//llvm/utils/unittest:gtest", + ] + sources = [ + "Error.cpp", + "SupportHelpers.cpp", + ] + testonly = true +} Index: llvm/trunk/utils/gn/secondary/llvm/lib/TextAPI/BUILD.gn =================================================================== --- llvm/trunk/utils/gn/secondary/llvm/lib/TextAPI/BUILD.gn +++ llvm/trunk/utils/gn/secondary/llvm/lib/TextAPI/BUILD.gn @@ -0,0 +1,12 @@ +static_library("TextAPI") { + output_name = "LLVMTextAPI" + deps = [ + "//llvm/lib/BinaryFormat", + "//llvm/lib/Support", + ] + include_dirs = [ "." ] + sources = [ + "ELF/ELFStub.cpp", + "ELF/TBEHandler.cpp", + ] +}