blob: a3d194189a839d245e6d8a2fdfeab70f29c0ba7a [file] [log] [blame]
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
'includes': [
'mozjs-45.gypi',
],
'variables': {
'generated_include_directory': '<(SHARED_INTERMEDIATE_DIR)/mozjs-45/include',
},
'target_defaults': {
'conditions': [
['target_arch == "x64"', {
'defines': [
'JS_CODEGEN_X64=1',
'JS_CPU_X64=1',
'JS_PUNBOX64=1',
],
}],
['target_arch == "mips"', {
'defines': [
'JS_CODEGEN_MIPS32=1',
'JS_CPU_MIPS=1',
'JS_NUNBOX32=1',
],
}],
['cobalt_config == "debug"', {
'defines': [
'DEBUG',
'JS_DEBUG',
],
}],
['cobalt_config != "gold"', {
'defines': [
'JS_TRACE_LOGGING=1',
],
}],
['cobalt_config == "debug" and cobalt_enable_jit == 1', {
'defines': [
'JS_JITSPEW=1',
],
}],
],
'defines': [
'JS_DEFAULT_JITREPORT_GRANULARITY=3',
],
},
'targets': [
{
'target_name': 'mozjs-45_lib',
'type': 'static_library',
'cflags': [
'-Wno-invalid-offsetof',
'-Wno-unused-function',
'-include <(DEPTH)/third_party/mozjs-45/cobalt_config/include/js-confdefs.h',
],
'dependencies': [
'build_include_directory',
'<(DEPTH)/starboard/client_porting/pr_starboard/pr_starboard.gyp:pr_starboard',
'<(DEPTH)/starboard/starboard.gyp:starboard',
'<(DEPTH)/third_party/icu/icu.gyp:icui18n',
'<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
],
'direct_dependent_settings': {
'include_dirs': [
'<(DEPTH)/third_party/mozjs-45/js/src',
'<(generated_include_directory)',
],
'cflags': [
'-Wno-invalid-offsetof',
'-Wno-unused-function',
'-include <(DEPTH)/third_party/mozjs-45/cobalt_config/include/js-confdefs.h',
],
'defines': [
'STATIC_JS_API=1',
],
'conditions': [
['target_arch == "x64"', {
'defines': [
'JS_CODEGEN_X64=1',
'JS_CPU_X64=1',
'JS_PUNBOX64=1',
],
}],
['target_arch == "mips"', {
'defines': [
'JS_CODEGEN_MIPS32=1',
'JS_CPU_MIPS=1',
'JS_NUNBOX32=1',
],
}],
],
},
'include_dirs': [
'<(DEPTH)/third_party/mozjs-45/js/src',
'<(DEPTH)/third_party/icu/source/common',
'<(generated_include_directory)',
],
'sources': [
'<@(mozjs-45_sources)',
],
'conditions': [
['target_arch == "x64" and cobalt_enable_jit == 1', {
'sources': [
'js/src/jit/x64/Assembler-x64.cpp',
'js/src/jit/x64/Bailouts-x64.cpp',
'js/src/jit/x64/BaselineCompiler-x64.cpp',
'js/src/jit/x64/BaselineIC-x64.cpp',
'js/src/jit/x64/CodeGenerator-x64.cpp',
'js/src/jit/x64/Lowering-x64.cpp',
'js/src/jit/x64/MacroAssembler-x64.cpp',
'js/src/jit/x64/SharedIC-x64.cpp',
'js/src/jit/x64/Trampoline-x64.cpp',
'js/src/jit/x86-shared/Architecture-x86-shared.cpp',
'js/src/jit/x86-shared/Assembler-x86-shared.cpp',
'js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp',
'js/src/jit/x86-shared/BaselineCompiler-x86-shared.cpp',
'js/src/jit/x86-shared/BaselineIC-x86-shared.cpp',
'js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp',
'js/src/jit/x86-shared/Disassembler-x86-shared.cpp',
'js/src/jit/x86-shared/Lowering-x86-shared.cpp',
'js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp',
'js/src/jit/x86-shared/MoveEmitter-x86-shared.cpp',
'<@(mozjs-45_jit_sources)',
],
},
],
['target_arch == "mips" and cobalt_enable_jit == 1', {
'sources': [
'js/src/jit/mips32/Architecture-mips32.cpp',
'js/src/jit/mips32/Assembler-mips32.cpp',
'js/src/jit/mips32/Bailouts-mips32.cpp',
'js/src/jit/mips32/BaselineCompiler-mips32.cpp',
'js/src/jit/mips32/BaselineIC-mips32.cpp',
'js/src/jit/mips32/CodeGenerator-mips32.cpp',
'js/src/jit/mips32/Lowering-mips32.cpp',
'js/src/jit/mips32/MacroAssembler-mips32.cpp',
'js/src/jit/mips32/MoveEmitter-mips32.cpp',
'js/src/jit/mips32/SharedIC-mips32.cpp',
'js/src/jit/mips32/Trampoline-mips32.cpp',
'js/src/jit/mips-shared/Architecture-mips-shared.cpp',
'js/src/jit/mips-shared/Assembler-mips-shared.cpp',
'js/src/jit/mips-shared/Bailouts-mips-shared.cpp',
'js/src/jit/mips-shared/BaselineCompiler-mips-shared.cpp',
'js/src/jit/mips-shared/BaselineIC-mips-shared.cpp',
'js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp',
'js/src/jit/mips-shared/Lowering-mips-shared.cpp',
'js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp',
'js/src/jit/mips-shared/MoveEmitter-mips-shared.cpp',
'<@(mozjs-45_jit_sources)',
],
}],
],
},
{
'target_name': 'mozjs-45_shell',
'type': '<(final_executable_type)',
'sources': [
'js/src/shell/js.cpp',
'js/src/shell/jsoptparse.cpp',
'js/src/shell/OSObject.cpp',
],
'dependencies': [
'mozjs-45_lib',
],
},
{
# SpiderMonkey source expects to include files from a certain directory
# structure that is made by copying (or symlinking) the real source files
# into the destination directory structure.
'target_name': 'build_include_directory',
'type': 'none',
'copies': [
{
'destination': '<(generated_include_directory)/mozilla',
'files': [
'memory/fallible/fallible.h',
'memory/mozalloc/mozalloc.h',
'memory/mozalloc/mozalloc_abort.h',
'memory/mozalloc/mozalloc_oom.h',
'memory/mozalloc/msvc_raise_wrappers.h',
'memory/mozalloc/throw_gcc.h',
'memory/mozalloc/throw_msvc.h',
'mfbt/Alignment.h',
'mfbt/AllocPolicy.h',
'mfbt/AlreadyAddRefed.h',
'mfbt/Array.h',
'mfbt/ArrayUtils.h',
'mfbt/Assertions.h',
'mfbt/Atomics.h',
'mfbt/Attributes.h',
'mfbt/BinarySearch.h',
'mfbt/BloomFilter.h',
'mfbt/Casting.h',
'mfbt/ChaosMode.h',
'mfbt/Char16.h',
'mfbt/CheckedInt.h',
'mfbt/Compiler.h',
'mfbt/Compression.h',
'mfbt/DebugOnly.h',
'mfbt/decimal/Decimal.h',
'mfbt/decimal/moz-decimal-utils.h',
'mfbt/double-conversion/bignum-dtoa.h',
'mfbt/double-conversion/bignum.h',
'mfbt/double-conversion/cached-powers.h',
'mfbt/double-conversion/diy-fp.h',
'mfbt/double-conversion/double-conversion.h',
'mfbt/double-conversion/fast-dtoa.h',
'mfbt/double-conversion/fixed-dtoa.h',
'mfbt/double-conversion/ieee.h',
'mfbt/double-conversion/strtod.h',
'mfbt/double-conversion/utils.h',
'mfbt/Endian.h',
'mfbt/EnumeratedArray.h',
'mfbt/EnumeratedRange.h',
'mfbt/EnumSet.h',
'mfbt/FastBernoulliTrial.h',
'mfbt/FloatingPoint.h',
'mfbt/Function.h',
'mfbt/GuardObjects.h',
'mfbt/HashFunctions.h',
'mfbt/IndexSequence.h',
'mfbt/IntegerPrintfMacros.h',
'mfbt/IntegerRange.h',
'mfbt/IntegerTypeTraits.h',
'mfbt/JSONWriter.h',
'mfbt/Likely.h',
'mfbt/LinkedList.h',
'mfbt/LinuxSignal.h',
'mfbt/lz4.h',
'mfbt/MacroArgs.h',
'mfbt/MacroForEach.h',
'mfbt/MathAlgorithms.h',
'mfbt/Maybe.h',
'mfbt/MaybeOneOf.h',
'mfbt/MemoryChecking.h',
'mfbt/MemoryReporting.h',
'mfbt/Move.h',
'mfbt/NullPtr.h',
'mfbt/NumericLimits.h',
'mfbt/Opaque.h',
'mfbt/Pair.h',
'mfbt/PodOperations.h',
'mfbt/Poison.h',
'mfbt/Range.h',
'mfbt/RangedArray.h',
'mfbt/RangedPtr.h',
'mfbt/ReentrancyGuard.h',
'mfbt/RefCounted.h',
'mfbt/RefCountType.h',
'mfbt/RefPtr.h',
'mfbt/ReverseIterator.h',
'mfbt/RollingMean.h',
'mfbt/Scoped.h',
'mfbt/ScopeExit.h',
'mfbt/SegmentedVector.h',
'mfbt/SHA1.h',
'mfbt/SizePrintfMacros.h',
'mfbt/Snprintf.h',
'mfbt/SplayTree.h',
'mfbt/TaggedAnonymousMemory.h',
'mfbt/TemplateLib.h',
'mfbt/ThreadLocal.h',
'mfbt/ToString.h',
'mfbt/Tuple.h',
'mfbt/TypedEnumBits.h',
'mfbt/Types.h',
'mfbt/TypeTraits.h',
'mfbt/UniquePtr.h',
'mfbt/UniquePtrExtensions.h',
'mfbt/unused.h',
'mfbt/Variant.h',
'mfbt/Vector.h',
'mfbt/WeakPtr.h',
'mfbt/WindowsVersion.h',
'mfbt/XorShift128PlusRNG.h',
'mozglue/misc/StackWalk.h',
'mozglue/misc/TimeStamp.h',
'mozglue/misc/TimeStamp_windows.h',
],
},
{
'destination': '<(generated_include_directory)/js',
'files': [
'js/public/CallArgs.h',
'js/public/CallNonGenericMethod.h',
'js/public/CharacterEncoding.h',
'js/public/Class.h',
'js/public/Conversions.h',
'js/public/Date.h',
'js/public/Debug.h',
'js/public/GCAPI.h',
'js/public/GCHashTable.h',
'js/public/HashTable.h',
'js/public/HeapAPI.h',
'js/public/Id.h',
'js/public/Initialization.h',
'js/public/LegacyIntTypes.h',
'js/public/MemoryMetrics.h',
'js/public/Principals.h',
'js/public/ProfilingFrameIterator.h',
'js/public/ProfilingStack.h',
'js/public/Proxy.h',
'js/public/RequiredDefines.h',
'js/public/RootingAPI.h',
'js/public/SliceBudget.h',
'js/public/StructuredClone.h',
'js/public/TraceableVector.h',
'js/public/TraceKind.h',
'js/public/TracingAPI.h',
'js/public/TrackedOptimizationInfo.h',
'js/public/TypeDecls.h',
'js/public/UbiNode.h',
'js/public/UbiNodeBreadthFirst.h',
'js/public/UbiNodeCensus.h',
'js/public/UbiNodeDominatorTree.h',
'js/public/UbiNodePostOrder.h',
'js/public/Utility.h',
'js/public/Value.h',
'js/public/Vector.h',
'js/public/WeakMapPtr.h',
],
},
{
'destination': '<(generated_include_directory)',
'files': [
'fake_generated/dist/include/js-config.h',
'fake_generated/js/src/jsautokw.h',
'fake_generated/js/src/selfhosted.out.h',
'fake_generated/js/src/shell/shellmoduleloader.out.h',
],
},
],
'hard_dependency': 1,
},
],
}