From aa9d6ad09d0d43ad2a35263fb45c272f40f95937 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Thu, 7 Mar 2019 13:39:50 +0000 Subject: [PATCH] Only build "common" on supported systems src/common/BUILD.gn contains common dawn configs and will be discovered by all Chromium builds. "common" doesn't build on all system, for example Fuchsia so we only expose the target if we are on a supported system. BUG=dawn:61 Change-Id: Ib12b1bd3e32529e1969fdc2fc50af05f8e97e7df Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5360 Reviewed-by: Corentin Wallez Commit-Queue: Corentin Wallez --- src/common/BUILD.gn | 57 ++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/common/BUILD.gn b/src/common/BUILD.gn index 3140b71cc7..58b60f28f2 100644 --- a/src/common/BUILD.gn +++ b/src/common/BUILD.gn @@ -71,30 +71,35 @@ config("dawn_internal") { # Common dawn library ############################################################################### -static_library("common") { - sources = [ - "Assert.cpp", - "Assert.h", - "BitSetIterator.h", - "Compiler.h", - "DynamicLib.cpp", - "DynamicLib.h", - "HashUtils.h", - "Math.cpp", - "Math.h", - "Platform.h", - "Result.h", - "Serial.h", - "SerialMap.h", - "SerialQueue.h", - "SerialStorage.h", - "SwapChainUtils.h", - "vulkan_platform.h", - "windows_with_undefs.h", - ] - - configs += [ ":dawn_internal" ] - deps = [ - "${dawn_root}/src/dawn:dawn_headers", - ] +# This GN file is discovered by all Chromium builds, but common doesn't support +# all of Chromium's OSes so we explicitly make the target visible only on +# systems we know Dawn is able to compile on. +if (is_win || is_linux || is_mac) { + static_library("common") { + sources = [ + "Assert.cpp", + "Assert.h", + "BitSetIterator.h", + "Compiler.h", + "DynamicLib.cpp", + "DynamicLib.h", + "HashUtils.h", + "Math.cpp", + "Math.h", + "Platform.h", + "Result.h", + "Serial.h", + "SerialMap.h", + "SerialQueue.h", + "SerialStorage.h", + "SwapChainUtils.h", + "vulkan_platform.h", + "windows_with_undefs.h", + ] + + configs += [ ":dawn_internal" ] + deps = [ + "${dawn_root}/src/dawn:dawn_headers", + ] + } }