From 1d6b6064f7d1644cd78618009bac0cdee6c6e8e1 Mon Sep 17 00:00:00 2001 From: "jbroman@chromium.org" Date: Tue, 8 Apr 2014 17:42:14 +0000 Subject: Move libusb/BUILD.gn to the main tree. This seems to be equivalent to the current gyp file. Tested with: gn gen out/Release_gn ninja -C out/Release_gn libusb BUG= Review URL: https://codereview.chromium.org/226363005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262447 0039d316-1c4b-4281-b951-d872f2087c98 --- BUILD.gn | 1 + third_party/libusb/BUILD.gn | 109 +++++++++++++++++++++++++ tools/gn/secondary/third_party/libusb/BUILD.gn | 109 ------------------------- 3 files changed, 110 insertions(+), 109 deletions(-) create mode 100644 third_party/libusb/BUILD.gn delete mode 100644 tools/gn/secondary/third_party/libusb/BUILD.gn diff --git a/BUILD.gn b/BUILD.gn index 4591422..a07e2e2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -36,6 +36,7 @@ group("root") { #"//third_party/icu:icudata", #"//third_party/leveldatabase", "//third_party/libpng", + "//third_party/libusb", "//third_party/re2", "//third_party/zlib", "//tools/gn", diff --git a/third_party/libusb/BUILD.gn b/third_party/libusb/BUILD.gn new file mode 100644 index 0000000..837e53c --- /dev/null +++ b/third_party/libusb/BUILD.gn @@ -0,0 +1,109 @@ +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +config("libusb_config") { + include_dirs = [ + "src/libusb", + ] +} + +static_library("libusb") { + sources = [ + "src/config.h", + "src/libusb/core.c", + "src/libusb/descriptor.c", + "src/libusb/hotplug.c", + "src/libusb/hotplug.h", + "src/libusb/interrupt.c", + "src/libusb/interrupt.h", + "src/libusb/io.c", + "src/libusb/libusb.h", + "src/libusb/libusbi.h", + "src/libusb/os/darwin_usb.c", + "src/libusb/os/darwin_usb.h", + "src/libusb/os/linux_udev.c", + "src/libusb/os/linux_usbfs.c", + "src/libusb/os/linux_usbfs.h", + "src/libusb/os/poll_posix.c", + "src/libusb/os/poll_posix.h", + "src/libusb/os/poll_windows.c", + "src/libusb/os/poll_windows.h", + "src/libusb/os/threads_posix.c", + "src/libusb/os/threads_posix.h", + "src/libusb/os/threads_windows.c", + "src/libusb/os/threads_windows.h", + "src/libusb/os/windows_common.h", + "src/libusb/os/windows_usb.c", + "src/libusb/os/windows_usb.h", + "src/libusb/sync.c", + "src/libusb/version.h", + "src/libusb/version_nano.h", + "src/msvc/config.h", + "src/msvc/inttypes.h", + "src/msvc/stdint.h", + ] + include_dirs = [ + "src/libusb/os", + ] + + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + + direct_dependent_configs = [ ":libusb_config" ] + + if (is_posix) { + defines = [ + "DEFAULT_VISIBILITY=", + "HAVE_GETTIMEOFDAY=1", + "HAVE_POLL_H=1", + "HAVE_SYS_TIME_H=1", + "LIBUSB_DESCRIBE=\"1.0.16\"", + "POLL_NFDS_TYPE=nfds_t", + "THREADS_POSIX=1", + ] + } + + if (is_mac) { + defines += [ "OS_DARWIN=1" ] + } else { + sources -= [ + "src/libusb/os/darwin_usb.c", + "src/libusb/os/darwin_usb.h", + ] + } + + if (is_linux || is_android) { + defines += [ + "HAVE_LIBUDEV=1", + "OS_LINUX=1", + "USE_UDEV=1", + "_GNU_SOURCE=1", + ] + configs += [ "//build/config/linux:udev" ] + } else { + sources -= [ + "src/libusb/os/linux_udev.c", + "src/libusb/os/linux_usbfs.c", + "src/libusb/os/linux_usbfs.h", + ] + } + + if (is_win) { + include_dirs += [ "src/msvc" ] + } else { + include_dirs += [ "src" ] + sources -= [ + "src/libusb/os/poll_windows.c", + "src/libusb/os/poll_windows.h", + "src/libusb/os/threads_windows.c", + "src/libusb/os/threads_windows.h", + "src/libusb/os/windows_common.h", + "src/libusb/os/windows_usb.c", + "src/libusb/os/windows_usb.h", + "src/msvc/config.h", + "src/msvc/inttypes.h", + "src/msvc/stdint.h", + ] + } +} diff --git a/tools/gn/secondary/third_party/libusb/BUILD.gn b/tools/gn/secondary/third_party/libusb/BUILD.gn deleted file mode 100644 index b374316..0000000 --- a/tools/gn/secondary/third_party/libusb/BUILD.gn +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (c) 2013 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -config("libusb_config") { - include_dirs = [ - "src/libusb", - ] -} - -static_library("libusb") { - sources = [ - "src/config.h", - "src/libusb/core.c", - "src/libusb/descriptor.c", - "src/libusb/hotplug.c", - "src/libusb/hotplug.h", - "src/libusb/interrupt.c", - "src/libusb/interrupt.h", - "src/libusb/io.c", - "src/libusb/libusb.h", - "src/libusb/libusbi.h", - "src/libusb/os/darwin_usb.c", - "src/libusb/os/darwin_usb.h", - "src/libusb/os/linux_udev.c", - "src/libusb/os/linux_usbfs.c", - "src/libusb/os/linux_usbfs.h", - "src/libusb/os/poll_posix.c", - "src/libusb/os/poll_posix.h", - "src/libusb/os/poll_windows.c", - "src/libusb/os/poll_windows.h", - "src/libusb/os/threads_posix.c", - "src/libusb/os/threads_posix.h", - "src/libusb/os/threads_windows.c", - "src/libusb/os/threads_windows.h", - "src/libusb/os/windows_common.h", - "src/libusb/os/windows_usb.c", - "src/libusb/os/windows_usb.h", - "src/libusb/sync.c", - "src/libusb/version.h", - "src/libusb/version_nano.h", - "src/msvc/config.h", - "src/msvc/inttypes.h", - "src/msvc/stdint.h", - ] - include_dirs = [ - "src/libusb/os", - ] - - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - - direct_dependent_configs = [ ":libusb_config" ] - - if (is_posix) { - defines = [ - "DEFAULT_VISIBILITY=", - "HAVE_GETTIMEOFDAY=1", - "HAVE_POLL_H=1", - "HAVE_SYS_TIME_H=1", - "LIBUSB_DESCRIBE=\"1.0.16\"", - "POLL_NFDS_TYPE=nfds_t", - "THREADS_POSIX=1", - ] - } - - if (is_mac) { - defines += [ "OS_DARWIN=1" ] - } else { - sources -= [ - "src/libusb/os/darwin_usb.c", - "src/libusb/os/darwin_usb.h", - ] - } - - if (is_linux || is_android) { - defines += [ - "HAVE_LIBUDEV=1", - "OS_LINUX=1", - "USE_UDEV=1", - "_GNU_SOURCE=1", - ] - configs += [ "//build/config/linux:udev" ] - } else { - sources -= [ - "src/libusb/os/linux_udev.c", - "src/libusb/os/linux_usbfs.c", - "src/libusb/os/linux_usbfs.h", - ] - } - - if (is_win) { - include_dirs += [ "src/msvc" ] - } else { - include_dirs += [ "src" ] - sources -= [ - "src/libusb/os/poll_windows.c", - "src/libusb/os/poll_windows.h", - "src/libusb/os/threads_windows.c", - "src/libusb/os/threads_windows.h", - "src/libusb/os/windows_common.h", - "src/libusb/os/windows_usb.c", - "src/libusb/os/windows_usb.h", - "src/msvc/config.h", - "src/msvc/inttypes.h", - "src/msvc/stdint.h", - ] - } -} -- cgit v1.1