20231003 update

This commit is contained in:
jkjoy 2023-10-03 11:16:25 +08:00
commit 077219a71e
221 changed files with 38189 additions and 2 deletions

View File

@ -1067,6 +1067,12 @@ links:
link: "https://kr.ci/",
avatar: "https://oss.yiki.tech/img/202304230342713.jpg"
}
- {
title: "橘夜庭",
intro: "是微甜的呀~",
link: "https://musenxi.com",
avatar: "https://s2.loli.net/2022/07/02/t3o7zAFqUxNkuBP.png"
}
# 当成员头像加载失败时,替换为指定图片
# When the member avatar fails to load, replace the specified image
onerror_avatar: /img/avatar.png

File diff suppressed because one or more lines are too long

14968
node_modules/.package-lock.json generated vendored

File diff suppressed because it is too large Load Diff

22
node_modules/bindings/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

98
node_modules/bindings/README.md generated vendored Normal file
View File

@ -0,0 +1,98 @@
node-bindings
=============
### Helper module for loading your native module's `.node` file
This is a helper module for authors of Node.js native addon modules.
It is basically the "swiss army knife" of `require()`ing your native module's
`.node` file.
Throughout the course of Node's native addon history, addons have ended up being
compiled in a variety of different places, depending on which build tool and which
version of node was used. To make matters worse, now the `gyp` build tool can
produce either a __Release__ or __Debug__ build, each being built into different
locations.
This module checks _all_ the possible locations that a native addon would be built
at, and returns the first one that loads successfully.
Installation
------------
Install with `npm`:
``` bash
$ npm install --save bindings
```
Or add it to the `"dependencies"` section of your `package.json` file.
Example
-------
`require()`ing the proper bindings file for the current node version, platform
and architecture is as simple as:
``` js
var bindings = require('bindings')('binding.node')
// Use your bindings defined in your C files
bindings.your_c_function()
```
Nice Error Output
-----------------
When the `.node` file could not be loaded, `node-bindings` throws an Error with
a nice error message telling you exactly what was tried. You can also check the
`err.tries` Array property.
```
Error: Could not load the bindings file. Tried:
→ /Users/nrajlich/ref/build/binding.node
→ /Users/nrajlich/ref/build/Debug/binding.node
→ /Users/nrajlich/ref/build/Release/binding.node
→ /Users/nrajlich/ref/out/Debug/binding.node
→ /Users/nrajlich/ref/Debug/binding.node
→ /Users/nrajlich/ref/out/Release/binding.node
→ /Users/nrajlich/ref/Release/binding.node
→ /Users/nrajlich/ref/build/default/binding.node
→ /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node
at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13)
at Object.<anonymous> (/Users/nrajlich/ref/lib/ref.js:5:47)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
...
```
The searching for the `.node` file will originate from the first directory in which has a `package.json` file is found.
License
-------
(The MIT License)
Copyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

221
node_modules/bindings/bindings.js generated vendored Normal file
View File

@ -0,0 +1,221 @@
/**
* Module dependencies.
*/
var fs = require('fs'),
path = require('path'),
fileURLToPath = require('file-uri-to-path'),
join = path.join,
dirname = path.dirname,
exists =
(fs.accessSync &&
function(path) {
try {
fs.accessSync(path);
} catch (e) {
return false;
}
return true;
}) ||
fs.existsSync ||
path.existsSync,
defaults = {
arrow: process.env.NODE_BINDINGS_ARROW || ' → ',
compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',
platform: process.platform,
arch: process.arch,
nodePreGyp:
'node-v' +
process.versions.modules +
'-' +
process.platform +
'-' +
process.arch,
version: process.versions.node,
bindings: 'bindings.node',
try: [
// node-gyp's linked version in the "build" dir
['module_root', 'build', 'bindings'],
// node-waf and gyp_addon (a.k.a node-gyp)
['module_root', 'build', 'Debug', 'bindings'],
['module_root', 'build', 'Release', 'bindings'],
// Debug files, for development (legacy behavior, remove for node v0.9)
['module_root', 'out', 'Debug', 'bindings'],
['module_root', 'Debug', 'bindings'],
// Release files, but manually compiled (legacy behavior, remove for node v0.9)
['module_root', 'out', 'Release', 'bindings'],
['module_root', 'Release', 'bindings'],
// Legacy from node-waf, node <= 0.4.x
['module_root', 'build', 'default', 'bindings'],
// Production "Release" buildtype binary (meh...)
['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],
// node-qbs builds
['module_root', 'addon-build', 'release', 'install-root', 'bindings'],
['module_root', 'addon-build', 'debug', 'install-root', 'bindings'],
['module_root', 'addon-build', 'default', 'install-root', 'bindings'],
// node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']
]
};
/**
* The main `bindings()` function loads the compiled bindings for a given module.
* It uses V8's Error API to determine the parent filename that this function is
* being invoked from, which is then used to find the root directory.
*/
function bindings(opts) {
// Argument surgery
if (typeof opts == 'string') {
opts = { bindings: opts };
} else if (!opts) {
opts = {};
}
// maps `defaults` onto `opts` object
Object.keys(defaults).map(function(i) {
if (!(i in opts)) opts[i] = defaults[i];
});
// Get the module root
if (!opts.module_root) {
opts.module_root = exports.getRoot(exports.getFileName());
}
// Ensure the given bindings name ends with .node
if (path.extname(opts.bindings) != '.node') {
opts.bindings += '.node';
}
// https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
var requireFunc =
typeof __webpack_require__ === 'function'
? __non_webpack_require__
: require;
var tries = [],
i = 0,
l = opts.try.length,
n,
b,
err;
for (; i < l; i++) {
n = join.apply(
null,
opts.try[i].map(function(p) {
return opts[p] || p;
})
);
tries.push(n);
try {
b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
if (!opts.path) {
b.path = n;
}
return b;
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND' &&
e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&
!/not find/i.test(e.message)) {
throw e;
}
}
}
err = new Error(
'Could not locate the bindings file. Tried:\n' +
tries
.map(function(a) {
return opts.arrow + a;
})
.join('\n')
);
err.tries = tries;
throw err;
}
module.exports = exports = bindings;
/**
* Gets the filename of the JavaScript file that invokes this function.
* Used to help find the root directory of a module.
* Optionally accepts an filename argument to skip when searching for the invoking filename
*/
exports.getFileName = function getFileName(calling_file) {
var origPST = Error.prepareStackTrace,
origSTL = Error.stackTraceLimit,
dummy = {},
fileName;
Error.stackTraceLimit = 10;
Error.prepareStackTrace = function(e, st) {
for (var i = 0, l = st.length; i < l; i++) {
fileName = st[i].getFileName();
if (fileName !== __filename) {
if (calling_file) {
if (fileName !== calling_file) {
return;
}
} else {
return;
}
}
}
};
// run the 'prepareStackTrace' function above
Error.captureStackTrace(dummy);
dummy.stack;
// cleanup
Error.prepareStackTrace = origPST;
Error.stackTraceLimit = origSTL;
// handle filename that starts with "file://"
var fileSchema = 'file://';
if (fileName.indexOf(fileSchema) === 0) {
fileName = fileURLToPath(fileName);
}
return fileName;
};
/**
* Gets the root directory of a module, given an arbitrary filename
* somewhere in the module tree. The "root directory" is the directory
* containing the `package.json` file.
*
* In: /home/nate/node-native-module/lib/index.js
* Out: /home/nate/node-native-module
*/
exports.getRoot = function getRoot(file) {
var dir = dirname(file),
prev;
while (true) {
if (dir === '.') {
// Avoids an infinite loop in rare cases, like the REPL
dir = process.cwd();
}
if (
exists(join(dir, 'package.json')) ||
exists(join(dir, 'node_modules'))
) {
// Found the 'package.json' file or 'node_modules' dir; we're done
return dir;
}
if (prev === dir) {
// Got to the top
throw new Error(
'Could not find module root given file: "' +
file +
'". Do you have a `package.json` file? '
);
}
// Try the parent dir next
prev = dir;
dir = join(dir, '..');
}
};

28
node_modules/bindings/package.json generated vendored Normal file
View File

@ -0,0 +1,28 @@
{
"name": "bindings",
"description": "Helper module for loading your native module's .node file",
"keywords": [
"native",
"addon",
"bindings",
"gyp",
"waf",
"c",
"c++"
],
"version": "1.5.0",
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-bindings.git"
},
"main": "./bindings.js",
"bugs": {
"url": "https://github.com/TooTallNate/node-bindings/issues"
},
"homepage": "https://github.com/TooTallNate/node-bindings",
"license": "MIT",
"dependencies": {
"file-uri-to-path": "1.0.0"
}
}

5
node_modules/buildcheck/.eslintrc.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
'use strict';
module.exports = {
extends: '@mscdex/eslint-config',
};

72
node_modules/buildcheck/.github/workflows/ci.yml generated vendored Normal file
View File

@ -0,0 +1,72 @@
name: CI
on:
pull_request:
push:
branches: [ master ]
jobs:
tests-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install module
run: npm install
- name: Run tests
run: npm test
tests-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install module
run: npm install
- name: Run tests
run: npm test
tests-windows-2019:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install module
run: npm install
- name: Run tests
run: npm test
tests-windows-2022:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install module
run: npm install
- name: Run tests
run: npm test

23
node_modules/buildcheck/.github/workflows/lint.yml generated vendored Normal file
View File

@ -0,0 +1,23 @@
name: lint
on:
pull_request:
push:
branches: [ master ]
env:
NODE_VERSION: 14.x
jobs:
lint-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install ESLint + ESLint configs/plugins
run: npm install --only=dev
- name: Lint files
run: npm run lint

3
node_modules/buildcheck/.npmignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
.eslintcache
**/node_modules/**
/package-lock.json

19
node_modules/buildcheck/LICENSE generated vendored Normal file
View File

@ -0,0 +1,19 @@
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

106
node_modules/buildcheck/README.md generated vendored Normal file
View File

@ -0,0 +1,106 @@
# Description
Build environment checking for [node.js](http://nodejs.org/).
This allows for autoconf-like functionality for node addons/build scripts.
**Note:** Obsolete and/or exotic build environments or platforms not supported
by node.js are not supported.
## Requirements
* [node.js](http://nodejs.org/) -- v10.0.0 or newer
* Supported compilers:
* gcc
* clang
* MSVC 2013+ and Windows SDK 8.1+
## Installation
npm install buildcheck
## Examples
### Check if a C function exists
```js
'use strict';
const BuildEnvironment = require('buildcheck');
const buildEnv = new BuildEnvironment();
console.log(buildEnv.checkFunction('c', 'preadv2'));
```
### Check if a C header is usable
```js
'use strict';
const BuildEnvironment = require('buildcheck');
const buildEnv = new BuildEnvironment();
console.log(buildEnv.checkHeader('c', 'linux/io_uring.h'));
```
### Try to compile some C code
```js
'use strict';
const BuildEnvironment = require('buildcheck');
const buildEnv = new BuildEnvironment();
// Should be a successful compile
console.log(buildEnv.tryCompile('c', 'int main() { return 0; }'));
// Should be a failed compile
console.log(buildEnv.tryCompile('c', 'int main() { return z; }'));
```
## API
### Exports
The exported value is `BuildEnvironment`, the main class for dealing with a build environment.
### BuildEnvironment
#### Methods
* **(constructor)**([< _object_ >config]) - Creates and returns a new BuildEnvironment instance. `config` may contain:
* **compilerC** - _string_ - C compiler command to use. *Note: this is ignored on Windows.* **Default:** `process.env.CC` or `'cc'`
* **compilerCXX** - _string_ - C++ compiler command to use. *Note: this is ignored on Windows.* **Default:** `process.env.CXX` or `'c++'`
* **msvs_version** - _mixed_ - A string or number containing the year of the Visual Studio compiler to use. *Note: this is for Windows only.* **Default:** newest version installed
* **checkDeclared**(< _string_ >lang, < _string_ >symbolName[, < _object_ >options]) - _boolean_ - Checks if a symbol `symbolName` is declared where `lang` is either `'c'` or `'c++'`. Returns `true` if symbol exists, `false` otherwise. `options` may contain:
* **headers** - _array_ - A list of headers to try when checking if the symbol is declared. `checkFunction()` will always first try without a library. If not supplied, a default list of common (platform-specific) headers will be used.
* **searchLibs** - _array_ - A list of library names (without the `'-l'` prefix) to try when checking if the symbol is declared. `checkDeclared()` will always first try without a library.
* **checkFunction**(< _string_ >lang, < _string_ >functionName[, < _object_ >options]) - _boolean_ - Checks if a function `functionName` exists and is linkable where `lang` is either `'c'` or `'c++'`. Returns `true` if function exists, `false` otherwise. `options` may contain:
* **searchLibs** - _array_ - A list of library names (without the `'-l'` prefix) to try when checking for this function. `checkFunction()` will always first try without a library.
* **checkFeature**(< _string_ >featureName) - _mixed_ - Executes a special test for a "feature" and returns the result. Supported values for `featureName`:
* `'strerror_r'` - Returns an object containing:
* `declared` - _boolean_ - Whether `strerror_r()` is declared
* `returnsCharPtr` - _boolean_ - If `strerror_r()` is declared, whether it returns `char*` (a GNU extension) or not.
* **checkHeader**(< _string_ >lang, < _string_ >headerName) - _boolean_ - Checks if the header `headerName` exists and is usable where `lang` is either `'c'` or `'c++'`. Returns `true` if the header exists and is usable, `false` otherwise.
* **defines**([< _string_ >lang[, < _boolean_ >rendered]]) - _array_ - Returns a list of features, functions, headers, and symbols known to be defined by this build environment instance. `lang` is either `'c'` or `'c++'` If `lang` is not set, defines for both `'c'` and `'c++'` will be returned. If `rendered` is `true` (defaults to `false`), autoconf-style defines (e.g. "HAVE_FOO=1") will be returned instead. Defines coming from features utilize base strings/names from autoconf for better compatibility.
* **libs**([< _string_ >lang]) - _array_ - Returns a list of (`'-l'`-prefixed) libraries known to be required for features and functions defined by this build environment instance. `lang` is either `'c'` or `'c++'` If `lang` is not set, defines for both `'c'` and `'c++'` will be returned.
* **tryCompile**(< _string_ >lang, < _string_ >code[, < _array_ >compilerParams]) - _mixed_ - Attempts to compile `code` where `lang` is either `'c'` or `'c++'`. `compilerParams` is an optional array of compiler/linker flags to include. Returns `true` on successful compilation, or an _Error_ instance with an `output` property containing the compiler error output.

250
node_modules/buildcheck/deps/Find-VisualStudio.cs generated vendored Normal file
View File

@ -0,0 +1,250 @@
// Copyright 2017 - Refael Ackermann
// Distributed under MIT style license
// See accompanying file LICENSE at https://github.com/node4good/windows-autoconf
// Usage:
// powershell -ExecutionPolicy Unrestricted -Command "Add-Type -Path Find-VisualStudio.cs; [VisualStudioConfiguration.Main]::PrintJson()"
// This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7.
using System;
using System.Text;
using System.Runtime.InteropServices;
using System.Collections.Generic;
namespace VisualStudioConfiguration
{
[Flags]
public enum InstanceState : uint
{
None = 0,
Local = 1,
Registered = 2,
NoRebootRequired = 4,
NoErrors = 8,
Complete = 4294967295,
}
[Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface IEnumSetupInstances
{
void Next([MarshalAs(UnmanagedType.U4), In] int celt,
[MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt,
[MarshalAs(UnmanagedType.U4)] out int pceltFetched);
void Skip([MarshalAs(UnmanagedType.U4), In] int celt);
void Reset();
[return: MarshalAs(UnmanagedType.Interface)]
IEnumSetupInstances Clone();
}
[Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface ISetupConfiguration
{
}
[Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface ISetupConfiguration2 : ISetupConfiguration
{
[return: MarshalAs(UnmanagedType.Interface)]
IEnumSetupInstances EnumInstances();
[return: MarshalAs(UnmanagedType.Interface)]
ISetupInstance GetInstanceForCurrentProcess();
[return: MarshalAs(UnmanagedType.Interface)]
ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path);
[return: MarshalAs(UnmanagedType.Interface)]
IEnumSetupInstances EnumAllInstances();
}
[Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface ISetupInstance
{
}
[Guid("89143C9A-05AF-49B0-B717-72E218A2185C")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface ISetupInstance2 : ISetupInstance
{
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstanceId();
[return: MarshalAs(UnmanagedType.Struct)]
System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate();
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstallationName();
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstallationPath();
[return: MarshalAs(UnmanagedType.BStr)]
string GetInstallationVersion();
[return: MarshalAs(UnmanagedType.BStr)]
string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid);
[return: MarshalAs(UnmanagedType.BStr)]
string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid);
[return: MarshalAs(UnmanagedType.BStr)]
string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath);
[return: MarshalAs(UnmanagedType.U4)]
InstanceState GetState();
[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
ISetupPackageReference[] GetPackages();
ISetupPackageReference GetProduct();
[return: MarshalAs(UnmanagedType.BStr)]
string GetProductPath();
[return: MarshalAs(UnmanagedType.VariantBool)]
bool IsLaunchable();
[return: MarshalAs(UnmanagedType.VariantBool)]
bool IsComplete();
[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
ISetupPropertyStore GetProperties();
[return: MarshalAs(UnmanagedType.BStr)]
string GetEnginePath();
}
[Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface ISetupPackageReference
{
[return: MarshalAs(UnmanagedType.BStr)]
string GetId();
[return: MarshalAs(UnmanagedType.BStr)]
string GetVersion();
[return: MarshalAs(UnmanagedType.BStr)]
string GetChip();
[return: MarshalAs(UnmanagedType.BStr)]
string GetLanguage();
[return: MarshalAs(UnmanagedType.BStr)]
string GetBranch();
[return: MarshalAs(UnmanagedType.BStr)]
string GetType();
[return: MarshalAs(UnmanagedType.BStr)]
string GetUniqueId();
[return: MarshalAs(UnmanagedType.VariantBool)]
bool GetIsExtension();
}
[Guid("c601c175-a3be-44bc-91f6-4568d230fc83")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport]
public interface ISetupPropertyStore
{
[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
string[] GetNames();
object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName);
}
[Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")]
[CoClass(typeof(SetupConfigurationClass))]
[ComImport]
public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration
{
}
[Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")]
[ClassInterface(ClassInterfaceType.None)]
[ComImport]
public class SetupConfigurationClass
{
}
public static class Main
{
public static void PrintJson()
{
ISetupConfiguration query = new SetupConfiguration();
ISetupConfiguration2 query2 = (ISetupConfiguration2)query;
IEnumSetupInstances e = query2.EnumAllInstances();
int pceltFetched;
ISetupInstance2[] rgelt = new ISetupInstance2[1];
List<string> instances = new List<string>();
while (true)
{
e.Next(1, rgelt, out pceltFetched);
if (pceltFetched <= 0)
{
Console.WriteLine(String.Format("[{0}]", string.Join(",", instances.ToArray())));
return;
}
try
{
instances.Add(InstanceJson(rgelt[0]));
}
catch (COMException)
{
// Ignore instances that can't be queried.
}
}
}
private static string JsonString(string s)
{
return "\"" + s.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
}
private static string InstanceJson(ISetupInstance2 setupInstance2)
{
// Visual Studio component directory:
// https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids
StringBuilder json = new StringBuilder();
json.Append("{");
string path = JsonString(setupInstance2.GetInstallationPath());
json.Append(String.Format("\"path\":{0},", path));
string version = JsonString(setupInstance2.GetInstallationVersion());
json.Append(String.Format("\"version\":{0},", version));
List<string> packages = new List<string>();
foreach (ISetupPackageReference package in setupInstance2.GetPackages())
{
string id = JsonString(package.GetId());
packages.Add(id);
}
json.Append(String.Format("\"packages\":[{0}]", string.Join(",", packages.ToArray())));
json.Append("}");
return json.ToString();
}
}
}

345
node_modules/buildcheck/lib/findvs.js generated vendored Normal file
View File

@ -0,0 +1,345 @@
'use strict';
const { execFileSync } = require('child_process');
const { readFileSync, statSync } = require('fs');
const { win32: path } = require('path');
const VS_VERSIONS_MODERN = new Map([
[15, {
year: 2017,
msbuild: path.join('MSBuild', '15.0', 'Bin', 'MSBuild.exe'),
toolset: 'v141',
}],
[16, {
year: 2019,
msbuild: path.join('MSBuild', 'Current', 'Bin', 'MSBuild.exe'),
toolset: 'v142',
}],
[17, {
year: 2022,
msbuild:
(process.arch === 'x64'
? path.join('MSBuild', 'Current', 'Bin', 'amd64', 'MSBuild.exe')
: path.join('MSBuild', 'Current', 'Bin', 'MSBuild.exe')),
toolset: 'v143',
}],
]);
const PACKAGES = {
msbuild: /^Microsoft[.]VisualStudio[.]VC[.]MSBuild[.](?:v\d+[.])?Base$/i,
vctools: /^Microsoft[.]VisualStudio[.]Component[.]VC[.]Tools[.]x86[.]x64$/i,
express: /^Microsoft[.]VisualStudio[.]WDExpress$/i,
winsdk:
/^Microsoft[.]VisualStudio[.]Component[.]Windows(81|10|11)SDK(?:[.](\d+)(?:[.]Desktop.*)?)?$/,
};
const SDK_REG = 'HKLM\\Software\\Microsoft\\Microsoft SDKs\\Windows';
const SDK32_REG =
'HKLM\\Software\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows';
function checkRequiredPackages(packages) {
if (!Array.isArray(packages))
return false;
let foundMSBuild = false;
let foundVCTools = false;
let foundExpress = false;
for (const pkg of packages) {
if (!foundMSBuild && PACKAGES.msbuild.test(pkg))
foundMSBuild = true;
else if (!foundVCTools && PACKAGES.vctools.test(pkg))
foundVCTools = true;
else if (!foundExpress && PACKAGES.express.test(pkg))
foundExpress = true;
if (foundMSBuild && (foundVCTools || foundExpress))
return true;
}
}
// Sorts newest to oldest
function versionStringCompare(a, b) {
const splitA = a.split('.');
const splitB = b.split('.');
const len = Math.min(splitA.length, splitB.length);
for (let i = 0; i < len; ++i) {
const nA = parseInt(splitA[i], 10);
const nB = parseInt(splitB[i], 10);
if (nA > nB)
return -1;
if (nA < nB)
return 1;
}
if (splitA.length > splitB.length)
return -1;
else if (splitA.length < splitB.length)
return 1;
return 0;
}
function sdkVersionCompare(a, b) {
return versionStringCompare(a.fullVersion, b.fullVersion);
}
function getSDKPaths(fullVer) {
if (typeof fullVer !== 'string' || !fullVer)
return;
try {
const arch = (process.arch === 'ia32' ? 'x86' : 'x64');
const shortVer = `v${/^\d+[.]\d+/.exec(fullVer)[0]}`;
let verPath = getRegValue(`${SDK_REG}\\${shortVer}`, 'InstallationFolder');
if (!verPath)
verPath = getRegValue(`${SDK32_REG}\\${shortVer}`, 'InstallationFolder');
if (!verPath)
return;
// Includes
const includePaths = [];
for (const type of ['shared', 'um', 'ucrt']) {
const testPath = path.resolve(verPath, 'Include', fullVer, type);
statSync(testPath);
includePaths.push(testPath);
}
// Libraries
const libPaths = [];
for (const type of ['um', 'ucrt']) {
const testPath = path.resolve(verPath, 'Lib', fullVer, type, arch);
statSync(testPath);
libPaths.push(testPath);
}
return { includePaths, libPaths };
} catch {}
}
const execOpts = {
encoding: 'utf8',
stdio: ['ignore', 'pipe', 'pipe'],
windowsHide: true,
};
function findModernVS() {
const versions = [];
const ps = path.join(
process.env.SystemRoot,
'System32',
'WindowsPowerShell',
'v1.0',
'powershell.exe'
);
const cs = path.resolve(__dirname, '..', 'deps', 'Find-VisualStudio.cs');
const args = [
'-ExecutionPolicy',
'Unrestricted',
'-NoProfile',
'-Command',
`&{Add-Type -Path '${cs}';[VisualStudioConfiguration.Main]::PrintJson()}`
];
try {
const out = execFileSync(ps, args, execOpts);
const info = JSON.parse(out);
if (Array.isArray(info)) {
for (const vs of info) {
const vsPath = path.resolve(vs.path);
let vsVer = /^(?<major>\d+)[.](?<minor>\d+)[.]/.exec(vs.version);
if (!vsVer)
continue;
vsVer = {
full: vs.version,
major: +vsVer.groups.major,
minor: +vsVer.groups.minor,
};
const verInfo = VS_VERSIONS_MODERN.get(vsVer.major);
if (verInfo === undefined)
continue;
if (!checkRequiredPackages(vs.packages))
continue;
const vsSDKs = [];
for (const pkg of vs.packages) {
let fullVersion;
let version;
const m = PACKAGES.winsdk.exec(pkg);
if (!m)
continue;
const sdk = m[1];
switch (sdk) {
case '81':
fullVersion = version = '8.1';
break;
case '10':
case '11': {
if (m[2] === undefined)
continue;
const sdkVer = parseInt(m[2], 10);
if (!isFinite(sdkVer) || sdkVer < 0)
continue;
fullVersion = `10.0.${sdkVer}.0`;
version = '10.0';
break;
}
}
const paths = getSDKPaths(fullVersion);
if (!paths)
continue;
vsSDKs.push({
version,
fullVersion,
...paths,
});
}
if (vsSDKs.length === 0)
continue;
let clPath;
const includePaths = [];
const libPaths = [];
try {
let vcVerFile;
let clVer;
try {
vcVerFile = path.join(
vsPath,
'VC',
'Auxiliary',
'Build',
`Microsoft.VCToolsVersion.${verInfo.toolset}.default.txt`
);
clVer = readFileSync(vcVerFile, { encoding: 'utf8' }).trim();
} catch {}
if (!clVer) {
vcVerFile = path.join(
vsPath,
'VC',
'Auxiliary',
'Build',
'Microsoft.VCToolsVersion.default.txt'
);
clVer = readFileSync(vcVerFile, { encoding: 'utf8' }).trim();
}
const arch = (process.arch === 'ia32' ? 'x86' : 'x64');
let testPath = path.join(
vsPath,
'VC',
'Tools',
'MSVC',
clVer,
'bin',
`Host${arch}`,
arch,
'cl.exe'
);
statSync(testPath);
clPath = testPath;
testPath = path.join(
vsPath,
'VC',
'Tools',
'MSVC',
clVer,
'include'
);
statSync(testPath);
includePaths.push(testPath);
testPath = path.join(
vsPath,
'VC',
'Tools',
'MSVC',
clVer,
'lib',
arch
);
statSync(testPath);
libPaths.push(testPath);
} catch {
continue;
}
vsSDKs.sort(sdkVersionCompare);
versions.push({
path: vsPath,
version: vsVer,
sdks: vsSDKs,
...verInfo,
msbuild: path.join(vsPath, verInfo.msbuild),
cl: clPath,
includePaths,
libPaths,
});
}
}
} catch {}
return versions;
}
const VS_VERSIONS_OLDER = [
{
version: { full: '12.0', major: 12, minor: 0 },
year: 2013,
toolset: 'v120',
},
{
version: { full: '14.0', major: 14, minor: 0 },
year: 2015,
toolset: 'v140',
},
];
const VC_REG = 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7';
const VC32_REG =
'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7';
const MSBUILD_REG = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions';
function getRegValue(key, value, use32) {
const extraArgs = (use32 ? [ '/reg:32' ] : []);
const regexp = new RegExp(`^\\s+${value}\\s+REG_\\w+\\s+(\\S.*)$`, 'im');
const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe');
const args = [ 'query', key, '/v', value, ...extraArgs ];
try {
const out = execFileSync(reg, args, execOpts);
const m = regexp.exec(out);
if (m)
return m[1];
} catch {}
}
function findOlderVS() {
const versions = [];
try {
for (const vs of VS_VERSIONS_OLDER) {
let vsPath = getRegValue(VC_REG, vs.version.full);
if (!vsPath)
vsPath = getRegValue(VC32_REG, vs.version.full);
if (!vsPath)
continue;
vsPath = path.resolve(vsPath, '..');
const msbuildPath = getRegValue(
`${MSBUILD_REG}\\${vs.version.full}`,
'MSBuildToolsPath',
(process.arch === 'ia32')
);
if (!msbuildPath)
continue;
versions.push({
path: vsPath,
...vs,
msbuild: path.join(msbuildPath, 'MSBuild.exe'),
cl: path.join(vsPath, 'VC', 'bin', 'cl.exe'),
includePaths: [path.join(vsPath, 'VC', 'include')],
libPaths: [path.join(vsPath, 'VC', 'lib')],
sdks: [],
});
}
} catch {}
return versions;
}
module.exports = () => {
const versions = findModernVS().concat(findOlderVS());
// Sorts newest to oldest
versions.sort((a, b) => {
return versionStringCompare(a.version.full, b.version.full);
});
return versions;
};

738
node_modules/buildcheck/lib/index.js generated vendored Normal file
View File

@ -0,0 +1,738 @@
'use strict';
// TODO: take `compilerParams`, headers into account in cache for all cached
// results
// TODO: debug output
const { spawnSync } = require('child_process');
const { unlinkSync, writeFileSync } = require('fs');
const { tmpdir } = require('os');
const { win32: path } = require('path');
const { inspect } = require('util');
const isWindows = (process.platform === 'win32');
const findVS = require('./findvs.js');
const RE_HEADER_DECORATED = /^(?:"(.+)")|(?:<(.+)>)$/;
const genWinTmpFilenames = (() => {
let instance = 1;
return () => {
const base =
path.resolve(tmpdir(), `_buildcheck-${process.pid}-${instance++}`);
return {
input: `${base}.in.tmp`,
object: `${base}.out.obj`,
output: `${base}.out.tmp`,
};
};
})();
function getKind(prop) {
const spawnOpts = {
encoding: 'utf8',
stdio: 'pipe',
windowsHide: true,
};
const lang = (prop === '_cc' ? 'c' : 'c++');
if (isWindows) {
spawnOpts.stdio = [ 'ignore', 'pipe', 'pipe' ];
writeFileSync(this._tmpInFile, [
'_MSC_VER',
].join(' '));
const result = spawnSync(
this[prop],
[ '-EP', `-T${lang === 'c' ? 'c' : 'p'}`, this._tmpInFile],
spawnOpts
);
unlinkSync(this._tmpInFile);
if (result.status === 0) {
const values = result.stdout.trim().split(' ');
if (values.length === 1 && /^\d+$/.test(values[0])) {
this[`${prop}Kind`] = 'msvc';
this[`${prop}Version`] = values[0];
this[`${prop}SpawnOpts`] = spawnOpts;
this._debug(
`>>> Detected MSVC ${values[0]} for ${lang.toUpperCase()} language`
);
return;
}
}
} else {
const result = spawnSync(
this[prop],
[ '-E', '-P', '-x', lang, '-' ],
{
...spawnOpts,
input: [
'__clang__',
'__GNUC__',
'__GNUC_MINOR__',
'__GNUC_PATCHLEVEL__',
'__clang_major__',
'__clang_minor__',
'__clang_patchlevel__',
].join(' '),
}
);
if (result.status === 0) {
const values = result.stdout.trim().split(' ');
if (values.length === 7) {
let kind;
let version;
if (values[0] === '1') {
kind = 'clang';
version = values.slice(4).map((v) => +v);
} else {
kind = 'gnu';
version = values.slice(1, 4).map((v) => +v);
}
let good = true;
for (const part of version) {
if (!isFinite(part) || part < 0) {
good = false;
break;
}
}
if (good) {
this[`${prop}Kind`] = kind;
this[`${prop}Version`] = version;
this[`${prop}SpawnOpts`] = spawnOpts;
const verStr = version.join('.');
this._debug(
`>>> Detected ${kind} ${verStr} for ${lang.toUpperCase()} language`
);
return;
}
}
}
}
throw new Error('Unable to detect compiler type');
}
class BuildEnvironment {
constructor(cfg) {
if (typeof cfg !== 'object' || cfg === null)
cfg = {};
this._debug = (typeof cfg.debug === 'function' ? cfg.debug : () => {});
let cc;
let cxx;
if (isWindows) {
const versions = findVS();
this._debug(
`>>> Detected MSVS installations: ${inspect(versions, false, 10)}`
);
if (versions.length === 0)
throw new Error('Unable to detect compiler type');
let selected_msvs;
if (cfg.msvs_version
&& (typeof cfg.msvs_version === 'string'
|| typeof cfg.msvs_version === 'number')) {
this._debug(`>>> Explicit MSVS requested: ${cfg.msvs_version}`);
// Try to select compiler by year
const msvs_version = cfg.msvs_version.toString();
for (const vs of versions) {
if (vs.year.toString() === msvs_version) {
selected_msvs = vs;
break;
}
}
if (selected_msvs === undefined)
throw new Error(`Unable to find MSVS with year '${msvs_version}'`);
} else {
selected_msvs = versions[0]; // Use newest
}
this._debug(`>>> Using MSVS: ${selected_msvs.year}`);
cc = selected_msvs.cl;
cxx = cc;
this._includePaths = selected_msvs.includePaths;
this._libPaths = selected_msvs.libPaths;
// Add (newest) SDK paths if we have them
for (const sdk of selected_msvs.sdks) {
this._debug(`>>> Using Windows SDK: ${sdk.fullVersion}`);
this._includePaths = this._includePaths.concat(sdk.includePaths);
this._libPaths = this._libPaths.concat(sdk.libPaths);
break;
}
const { input, object, output } = genWinTmpFilenames();
this._tmpInFile = input;
this._tmpObjFile = object;
this._tmpOutFile = output;
} else {
cc = ((typeof cfg.compilerC === 'string' && cfg.compilerC)
|| process.env.CC
|| 'cc');
cxx = ((typeof cfg.compilerCXX === 'string' && cfg.compilerCXX)
|| process.env.CXX
|| 'c++');
this._debug(`>>> Using C compiler: ${cc}`);
this._debug(`>>> Using C++ compiler: ${cxx}`);
}
this._cc = cc;
this._ccKind = undefined;
this._ccVersion = undefined;
this._ccSpawnOpts = undefined;
this._cxx = cxx;
this._cxxKind = undefined;
this._cxxVersion = undefined;
this._cxxSpawnOpts = undefined;
if (cfg.cache !== false) {
this._cache = new Map(Object.entries({
c: new Map(),
cxx: new Map(),
}));
} else {
this._cache = null;
}
}
checkDeclared(type, symbolName, opts) {
validateType(type);
if (typeof symbolName !== 'string' || !symbolName)
throw new Error(`Invalid symbol name: ${inspect(symbolName)}`);
const cached = getCachedValue(type, this._cache, 'declared', symbolName);
if (cached !== undefined) {
this._debug(
`>>> Checking if '${symbolName}' is declared... ${cached} (cached)`
);
return cached;
}
if (typeof opts !== 'object' || opts === null)
opts = {};
const { headers, searchLibs } = opts;
const headersList = renderHeaders(Array.isArray(headers)
? headers
: getDefaultHeaders(this, type));
const declName = symbolName.replace(/ *\(.*/, '');
const declUse = symbolName.replace(/\(/, '((')
.replace(/\)/, ') 0)')
.replace(/,/g, ') 0, (');
const libs = [
'',
...(Array.isArray(searchLibs) ? searchLibs : [])
];
for (let lib of libs) {
if (typeof lib !== 'string')
continue;
lib = lib.trim();
const code = `
${headersList}
int
main ()
{
#ifndef ${declName}
#ifdef __cplusplus
(void) ${declUse};
#else
(void) ${declName};
#endif
#endif
;
return 0;
}`;
const compilerParams = (lib ? [`-l${lib}`] : []);
const result = this.tryCompile(type, code, compilerParams);
this._debug(
`>>> Checking if '${symbolName}' is declared `
+ `(using ${lib ? `'${lib}'` : 'no'} library)... ${result === true}`
);
if (result !== true) {
this._debug('... check failed with compiler output:');
this._debug(result.output);
}
if (result === true) {
setCachedValue(
type,
this._cache,
'declared',
symbolName,
(result === true)
);
return true;
}
}
return false;
}
checkFeature(name) {
const cached = getCachedValue('features', this._cache, null, name);
if (cached !== undefined) {
if (typeof cached === 'object'
&& cached !== null
&& typeof cached.val !== undefined) {
return cached.val;
}
return cached;
}
const feature = features.get(name);
if (feature === undefined)
throw new Error(`Invalid feature: ${name}`);
let result = feature(this);
if (result === undefined)
result = null;
setCachedValue('features', this._cache, null, name, result);
if (typeof result === 'object'
&& result !== null
&& typeof result.val !== undefined) {
return result.val;
}
return result;
}
checkFunction(type, funcName, opts) {
validateType(type);
if (typeof funcName !== 'string' || !funcName)
throw new Error(`Invalid function name: ${inspect(funcName)}`);
const cached = getCachedValue(type, this._cache, 'functions', funcName);
if (cached !== undefined) {
this._debug(
`>>> Checking if function '${funcName}' exists... true (cached)`
);
return true;
}
if (typeof opts !== 'object' || opts === null)
opts = {};
const { searchLibs } = opts;
const libs = [
'',
...(Array.isArray(searchLibs) ? searchLibs : [])
];
for (let lib of libs) {
if (typeof lib !== 'string')
continue;
lib = lib.trim();
const code = `
/* Define ${funcName} to an innocuous variant, in case <limits.h> declares
${funcName}.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define ${funcName} innocuous_${funcName}
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char ${funcName} (); below. */
#include <limits.h>
#undef ${funcName}
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ${funcName} ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_${funcName} || defined __stub___${funcName}
choke me
#endif
int
main ()
{
return ${funcName} ();
;
return 0;
}`;
const compilerParams = (lib ? [`-l${lib}`] : []);
const result = this.tryCompile(type, code, compilerParams);
this._debug(
`>>> Checking if function '${funcName}' exists `
+ `(using ${lib ? `'${lib}'` : 'no'} library)... ${result === true}`
);
if (result !== true) {
this._debug('... check failed with compiler output:');
this._debug(result.output);
}
if (result === true) {
setCachedValue(
type,
this._cache,
'functions',
funcName,
compilerParams
);
return true;
}
}
return false;
}
checkHeader(type, header) {
validateType(type);
const cached = getCachedValue(
type,
this._cache,
'headers',
normalizeHeader(header)
);
if (cached !== undefined) {
this._debug(
`>>> Checking if header '${header}' exists... ${cached} (cached)`
);
return cached;
}
const headersList = renderHeaders([header]);
const code = `
${headersList}
int
main ()
{
return 0;
}`;
const result = this.tryCompile(type, code);
setCachedValue(
type,
this._cache,
'headers',
normalizeHeader(header),
(result === true)
);
this._debug(
`>>> Checking if header '${header}' exists... ${result === true}`
);
if (result !== true) {
this._debug('... check failed with compiler output:');
this._debug(result.output);
}
return (result === true);
}
defines(type, rendered) {
if (this._cache === null)
return [];
const defines = new Map();
let types;
if (!['c', 'c++'].includes(type))
types = ['c', 'c++'];
else
types = [type];
for (const t of types) {
const typeCache = this._cache.get(t);
if (!typeCache)
continue;
for (const [subtype, entries] of typeCache) {
for (let name of entries.keys()) {
if (subtype === 'headers')
name = name.replace(RE_HEADER_DECORATED, '$1$2');
defines.set(makeDefine(name, rendered), 1);
}
}
}
{
const featuresCache = this._cache.get('features');
if (featuresCache) {
for (const result of featuresCache.values()) {
if (typeof result === 'object'
&& result !== null
&& Array.isArray(result.defines)) {
for (const define of result.defines)
defines.set(makeDefine(define, rendered), 1);
}
}
}
}
return Array.from(defines.keys());
}
libs(type) {
if (this._cache === null)
return [];
const libs = new Map();
let types;
if (!['c', 'c++'].includes(type))
types = ['c', 'c++'];
else
types = [type];
for (const t of types) {
const typeCache = this._cache.get(t);
if (!typeCache)
continue;
const functionsCache = typeCache.get('functions');
if (!functionsCache)
continue;
for (const compilerParams of functionsCache.values()) {
for (const param of compilerParams)
libs.set(param, 1);
}
}
{
const featuresCache = this._cache.get('features');
if (featuresCache) {
for (const result of featuresCache.values()) {
if (typeof result === 'object'
&& result !== null
&& Array.isArray(result.libs)) {
for (const lib of result.libs)
libs.set(lib, 1);
}
}
}
}
return Array.from(libs.keys());
}
tryCompile(type, code, compilerParams) {
validateType(type);
if (typeof code !== 'string')
throw new TypeError('Invalid code argument');
type = (type === 'c' ? 'c' : 'c++');
const prop = (type === 'c' ? '_cc' : '_cxx');
if (this[`${prop}Kind`] === undefined)
getKind.call(this, prop);
if (!Array.isArray(compilerParams))
compilerParams = [];
let result;
if (this[`${prop}Kind`] === 'msvc') {
const cmpOpts = [`-Fo${this._tmpObjFile}`];
for (const includePath of this._includePaths)
cmpOpts.push('-I', includePath);
const lnkOpts = [];
for (const libPath of this._libPaths)
lnkOpts.push(`-LIBPATH:${libPath}`);
for (const opt of compilerParams) {
let m;
if (m = /^[-/]l(.+)$/.exec(opt))
lnkOpts.push(m[1]);
else
cmpOpts.push(opt);
}
try {
writeFileSync(this._tmpInFile, code);
const args = [
...cmpOpts,
`-T${prop === '_cc' ? 'c' : 'p'}`,
this._tmpInFile,
'-link',
`-out:${this._tmpOutFile}`,
...lnkOpts,
];
result = spawnSync(
this[prop],
args,
this[`${prop}SpawnOpts`]
);
unlinkSync(this._tmpInFile);
// Overwrite stderr with stdout because MSVC seems to print
// errors to stdout instead for some reason
result.stderr = result.stdout;
} catch (ex) {
// We had trouble writing or deleting a temp file, fake
// the result
result = { status: Infinity, stderr: ex.stack };
}
try { unlinkSync(this._tmpObjFile); } catch {}
try { unlinkSync(this._tmpOutFile); } catch {}
} else {
result = spawnSync(
this[prop],
[
'-x', type,
'-o', '/dev/null',
'-',
...compilerParams,
],
{
...this[`${prop}SpawnOpts`],
input: code,
}
);
}
if (result.status === 0)
return true;
const err = new Error('Compilation failed');
err.output = result.stderr;
return err;
}
}
function validateType(type) {
if (!['c', 'c++'].includes(type))
throw new Error('Invalid type argument');
}
function getCachedValue(type, cache, subtype, key) {
if (cache === null)
return;
const typeCache = cache.get(type);
if (!typeCache)
return;
const subtypeCache = (typeof subtype !== 'string'
? typeCache
: typeCache.get(subtype));
if (!subtypeCache)
return;
return subtypeCache.get(key);
}
function setCachedValue(type, cache, subtype, key, value) {
if (cache === null)
return;
let typeCache = cache.get(type);
if (!typeCache)
cache.set(type, typeCache = new Map());
let subtypeCache = (typeof subtype !== 'string'
? typeCache
: typeCache.get(subtype));
if (!subtypeCache)
typeCache.set(subtype, subtypeCache = new Map());
subtypeCache.set(key, value);
}
function renderHeaders(headers) {
let ret = '';
if (Array.isArray(headers)) {
for (const header of headers) {
if (typeof header !== 'string' || !header)
throw new Error(`Invalid header: ${inspect(header)}`);
ret += `#include ${normalizeHeader(header)}\n`;
}
}
return ret;
}
function normalizeHeader(header) {
if (!RE_HEADER_DECORATED.test(header))
header = `<${header}>`;
return header;
}
const DEFAULT_HEADERS_POSIX = [
'stdio.h',
'sys/types.h',
'sys/stat.h',
'stdlib.h',
'stddef.h',
'memory.h',
'string.h',
'strings.h',
'inttypes.h',
'stdint.h',
'unistd.h'
];
const DEFAULT_HEADERS_MSVC = [
'windows.h',
];
function getDefaultHeaders(be, type) {
const prop = (type === 'c' ? '_cc' : '_cxx');
if (be[`${prop}Kind`] === undefined)
getKind.call(be, prop);
let headers;
if (be[`${prop}Kind`] === 'msvc')
headers = DEFAULT_HEADERS_MSVC;
else
headers = DEFAULT_HEADERS_POSIX;
return headers.filter((hdr) => be.checkHeader(type, hdr));
}
const features = new Map(Object.entries({
'strerror_r': (be) => {
const defines = [];
let returnsCharPtr = false;
const declared = be.checkDeclared('c', 'strerror_r');
if (declared) {
const code = `
${renderHeaders(getDefaultHeaders(be, 'c'))}
int
main ()
{
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
char *p = strerror_r (0, buf, sizeof buf);
return !p || x;
;
return 0;
}`;
returnsCharPtr = (be.tryCompile('c', code) === true);
if (returnsCharPtr)
defines.push('STRERROR_R_CHAR_P');
}
return {
defines,
val: { declared, returnsCharPtr }
};
},
}));
function makeDefine(name, rendered) {
name = name.replace(/[*]/g, 'P')
.replace(/[^_A-Za-z0-9]/g, '_')
.toUpperCase();
return (rendered ? `HAVE_${name}=1` : name);
}
module.exports = BuildEnvironment;

36
node_modules/buildcheck/package.json generated vendored Normal file
View File

@ -0,0 +1,36 @@
{
"name": "buildcheck",
"version": "0.0.6",
"author": "Brian White <mscdex@mscdex.net>",
"description": "Build environment checking (a la autoconf) for node.js",
"main": "./lib/index.js",
"engines": {
"node": ">=10.0.0"
},
"devDependencies": {
"@mscdex/eslint-config": "^1.1.0",
"eslint": "^7.0.0"
},
"scripts": {
"test": "node test/test.js",
"lint": "eslint --cache --report-unused-disable-directives --ext=.js .eslintrc.js lib",
"lint:fix": "npm run lint -- --fix"
},
"keywords": [
"build",
"autoconf",
"addons",
"compiler",
"environment"
],
"licenses": [
{
"type": "MIT",
"url": "http://github.com/mscdex/buildcheck/raw/master/LICENSE"
}
],
"repository": {
"type": "git",
"url": "http://github.com/mscdex/buildcheck.git"
}
}

8
node_modules/buildcheck/test/test.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
'use strict';
const BE = require('..');
{
// Test compiler detection
new BE({ debug: console.log });
}

22
node_modules/chokidar/node_modules/fsevents/LICENSE generated vendored Normal file
View File

@ -0,0 +1,22 @@
MIT License
-----------
Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

89
node_modules/chokidar/node_modules/fsevents/README.md generated vendored Normal file
View File

@ -0,0 +1,89 @@
# fsevents
Native access to MacOS FSEvents in [Node.js](https://nodejs.org/)
The FSEvents API in MacOS allows applications to register for notifications of
changes to a given directory tree. It is a very fast and lightweight alternative
to kqueue.
This is a low-level library. For a cross-platform file watching module that
uses fsevents, check out [Chokidar](https://github.com/paulmillr/chokidar).
## Usage
```sh
npm install fsevents
```
Supports only **Node.js v8.16 and higher**.
```js
const fsevents = require('fsevents');
// To start observation
const stop = fsevents.watch(__dirname, (path, flags, id) => {
const info = fsevents.getInfo(path, flags);
});
// To end observation
stop();
```
> **Important note:** The API behaviour is slightly different from typical JS APIs. The `stop` function **must** be
> retrieved and stored somewhere, even if you don't plan to stop the watcher. If you forget it, the garbage collector
> will eventually kick in, the watcher will be unregistered, and your callbacks won't be called anymore.
The callback passed as the second parameter to `.watch` get's called whenever the operating system detects a
a change in the file system. It takes three arguments:
###### `fsevents.watch(dirname: string, (path: string, flags: number, id: string) => void): () => Promise<undefined>`
* `path: string` - the item in the filesystem that have been changed
* `flags: number` - a numeric value describing what the change was
* `id: string` - an unique-id identifying this specific event
Returns closer callback which when called returns a Promise resolving when the watcher process has been shut down.
###### `fsevents.getInfo(path: string, flags: number, id: string): FsEventInfo`
The `getInfo` function takes the `path`, `flags` and `id` arguments and converts those parameters into a structure
that is easier to digest to determine what the change was.
The `FsEventsInfo` has the following shape:
```js
/**
* @typedef {'created'|'modified'|'deleted'|'moved'|'root-changed'|'cloned'|'unknown'} FsEventsEvent
* @typedef {'file'|'directory'|'symlink'} FsEventsType
*/
{
"event": "created", // {FsEventsEvent}
"path": "file.txt",
"type": "file", // {FsEventsType}
"changes": {
"inode": true, // Had iNode Meta-Information changed
"finder": false, // Had Finder Meta-Data changed
"access": false, // Had access permissions changed
"xattrs": false // Had xAttributes changed
},
"flags": 0x100000000
}
```
## Changelog
- v2.3 supports Apple Silicon ARM CPUs
- v2 supports node 8.16+ and reduces package size massively
- v1.2.8 supports node 6+
- v1.2.7 supports node 4+
## Troubleshooting
- I'm getting `EBADPLATFORM` `Unsupported platform for fsevents` error.
- It's fine, nothing is broken. fsevents is macos-only. Other platforms are skipped. If you want to hide this warning, report a bug to NPM bugtracker asking them to hide ebadplatform warnings by default.
## License
The MIT License Copyright (C) 2010-2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller — see LICENSE file.
Visit our [GitHub page](https://github.com/fsevents/fsevents) and [NPM Page](https://npmjs.org/package/fsevents)

View File

@ -0,0 +1,46 @@
declare type Event = "created" | "cloned" | "modified" | "deleted" | "moved" | "root-changed" | "unknown";
declare type Type = "file" | "directory" | "symlink";
declare type FileChanges = {
inode: boolean;
finder: boolean;
access: boolean;
xattrs: boolean;
};
declare type Info = {
event: Event;
path: string;
type: Type;
changes: FileChanges;
flags: number;
};
declare type WatchHandler = (path: string, flags: number, id: string) => void;
export declare function watch(path: string, handler: WatchHandler): () => Promise<void>;
export declare function watch(path: string, since: number, handler: WatchHandler): () => Promise<void>;
export declare function getInfo(path: string, flags: number): Info;
export declare const constants: {
None: 0x00000000;
MustScanSubDirs: 0x00000001;
UserDropped: 0x00000002;
KernelDropped: 0x00000004;
EventIdsWrapped: 0x00000008;
HistoryDone: 0x00000010;
RootChanged: 0x00000020;
Mount: 0x00000040;
Unmount: 0x00000080;
ItemCreated: 0x00000100;
ItemRemoved: 0x00000200;
ItemInodeMetaMod: 0x00000400;
ItemRenamed: 0x00000800;
ItemModified: 0x00001000;
ItemFinderInfoMod: 0x00002000;
ItemChangeOwner: 0x00004000;
ItemXattrMod: 0x00008000;
ItemIsFile: 0x00010000;
ItemIsDir: 0x00020000;
ItemIsSymlink: 0x00040000;
ItemIsHardlink: 0x00100000;
ItemIsLastHardlink: 0x00200000;
OwnEvent: 0x00080000;
ItemCloned: 0x00400000;
};
export {};

View File

@ -0,0 +1,83 @@
/*
** © 2020 by Philipp Dunkel, Ben Noordhuis, Elan Shankar, Paul Miller
** Licensed under MIT License.
*/
/* jshint node:true */
"use strict";
if (process.platform !== "darwin") {
throw new Error(`Module 'fsevents' is not compatible with platform '${process.platform}'`);
}
const Native = require("./fsevents.node");
const events = Native.constants;
function watch(path, since, handler) {
if (typeof path !== "string") {
throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path}`);
}
if ("function" === typeof since && "undefined" === typeof handler) {
handler = since;
since = Native.flags.SinceNow;
}
if (typeof since !== "number") {
throw new TypeError(`fsevents argument 2 must be a number and not a ${typeof since}`);
}
if (typeof handler !== "function") {
throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`);
}
let instance = Native.start(Native.global, path, since, handler);
if (!instance) throw new Error(`could not watch: ${path}`);
return () => {
const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined);
instance = undefined;
return result;
};
}
function getInfo(path, flags) {
return {
path,
flags,
event: getEventType(flags),
type: getFileType(flags),
changes: getFileChanges(flags),
};
}
function getFileType(flags) {
if (events.ItemIsFile & flags) return "file";
if (events.ItemIsDir & flags) return "directory";
if (events.MustScanSubDirs & flags) return "directory";
if (events.ItemIsSymlink & flags) return "symlink";
}
function anyIsTrue(obj) {
for (let key in obj) {
if (obj[key]) return true;
}
return false;
}
function getEventType(flags) {
if (events.ItemRemoved & flags) return "deleted";
if (events.ItemRenamed & flags) return "moved";
if (events.ItemCreated & flags) return "created";
if (events.ItemModified & flags) return "modified";
if (events.RootChanged & flags) return "root-changed";
if (events.ItemCloned & flags) return "cloned";
if (anyIsTrue(flags)) return "modified";
return "unknown";
}
function getFileChanges(flags) {
return {
inode: !!(events.ItemInodeMetaMod & flags),
finder: !!(events.ItemFinderInfoMod & flags),
access: !!(events.ItemChangeOwner & flags),
xattrs: !!(events.ItemXattrMod & flags),
};
}
exports.watch = watch;
exports.getInfo = getInfo;
exports.constants = events;

BIN
node_modules/chokidar/node_modules/fsevents/fsevents.node generated vendored Executable file

Binary file not shown.

View File

@ -0,0 +1,62 @@
{
"name": "fsevents",
"version": "2.3.3",
"description": "Native Access to MacOS FSEvents",
"main": "fsevents.js",
"types": "fsevents.d.ts",
"os": [
"darwin"
],
"files": [
"fsevents.d.ts",
"fsevents.js",
"fsevents.node"
],
"engines": {
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
},
"scripts": {
"clean": "node-gyp clean && rm -f fsevents.node",
"build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean",
"test": "/bin/bash ./test.sh 2>/dev/null",
"prepublishOnly": "npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/fsevents/fsevents.git"
},
"keywords": [
"fsevents",
"mac"
],
"contributors": [
{
"name": "Philipp Dunkel",
"email": "pip@pipobscure.com"
},
{
"name": "Ben Noordhuis",
"email": "info@bnoordhuis.nl"
},
{
"name": "Elan Shankar",
"email": "elan.shanker@gmail.com"
},
{
"name": "Miroslav Bajtoš",
"email": "mbajtoss@gmail.com"
},
{
"name": "Paul Miller",
"url": "https://paulmillr.com"
}
],
"license": "MIT",
"bugs": {
"url": "https://github.com/fsevents/fsevents/issues"
},
"homepage": "https://github.com/fsevents/fsevents",
"devDependencies": {
"node-gyp": "^9.4.0"
}
}

5
node_modules/cpu-features/.eslintrc.js generated vendored Normal file
View File

@ -0,0 +1,5 @@
'use strict';
module.exports = {
extends: '@mscdex/eslint-config',
};

68
node_modules/cpu-features/.github/workflows/ci.yml generated vendored Normal file
View File

@ -0,0 +1,68 @@
name: CI
on:
pull_request:
push:
branches: [ master ]
jobs:
tests-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check Node.js version
run: node -pe process.versions
- name: Install module
run: npm install
- name: Run tests
run: npm test
tests-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check Node.js version
run: node -pe process.versions
- name: Install module
run: npm install
- name: Run tests
run: npm test
tests-windows:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check Node.js version
run: node -pe process.versions
- name: Install module
run: npm install
- name: Run tests
run: npm test

27
node_modules/cpu-features/.github/workflows/lint.yml generated vendored Normal file
View File

@ -0,0 +1,27 @@
name: lint
on:
pull_request:
push:
branches: [ master ]
env:
NODE_VERSION: 20.x
jobs:
lint-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Check Node.js version
run: node -pe process.versions
- name: Install ESLint + ESLint configs/plugins
run: npm install
- name: Lint files
run: npm run lint

19
node_modules/cpu-features/LICENSE generated vendored Normal file
View File

@ -0,0 +1,19 @@
Copyright Brian White. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

59
node_modules/cpu-features/README.md generated vendored Normal file
View File

@ -0,0 +1,59 @@
Description
===========
A simple [node.js](https://nodejs.org) binding to [cpu_features](https://github.com/google/cpu_features) for obtaining information about installed CPU(s).
Requirements
============
* [node.js](http://nodejs.org/) -- v10.0.0 or newer
* An appropriate build environment -- see [node-gyp's documentation](https://github.com/nodejs/node-gyp/blob/master/README.md)
Install
=======
npm install cpu-features
Example
=======
```js
// Generally it's a good idea to just call this once and
// reuse the result since `cpu-features` does not cache
// the result itself.
const features = require('cpu-features')();
console.log(features);
// example output:
// { arch: 'x86',
// brand: 'Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz',
// family: 6,
// model: 58,
// stepping: 9,
// uarch: 'INTEL_IVB',
// flags:
// { fpu: true,
// tsc: true,
// cx8: true,
// clfsh: true,
// mmx: true,
// aes: true,
// erms: true,
// f16c: true,
// sse: true,
// sse2: true,
// sse3: true,
// ssse3: true,
// sse4_1: true,
// sse4_2: true,
// avx: true,
// pclmulqdq: true,
// cx16: true,
// popcnt: true,
// rdrnd: true,
// ss: true } }
```

16
node_modules/cpu-features/binding.gyp generated vendored Normal file
View File

@ -0,0 +1,16 @@
{
'targets': [
{
'target_name': 'cpufeatures',
'dependencies': [ 'deps/cpu_features/cpu_features.gyp:cpu_features' ],
'include_dirs': [
'src',
"<!(node -e \"require('nan')\")",
],
'sources': [
'src/binding.cc'
],
'cflags': [ '-O3' ],
},
],
}

352
node_modules/cpu-features/build/Makefile generated vendored Normal file
View File

@ -0,0 +1,352 @@
# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.
# The implicit make rules have it looking for RCS files, among other things.
# We instead explicitly write all the rules we care about.
# It's even quicker (saves ~200ms) to pass -r on the command line.
MAKEFLAGS=-r
# The source directory tree.
srcdir := ..
abs_srcdir := $(abspath $(srcdir))
# The name of the builddir.
builddir_name ?= .
# The V=1 flag on command line makes us verbosely print command lines.
ifdef V
quiet=
else
quiet=quiet_
endif
# Specify BUILDTYPE=Release on the command line for a release build.
BUILDTYPE ?= Release
# Directory all our build output goes into.
# Note that this must be two directories beneath src/ for unit tests to pass,
# as they reach into the src/ directory for data with relative paths.
builddir ?= $(builddir_name)/$(BUILDTYPE)
abs_builddir := $(abspath $(builddir))
depsdir := $(builddir)/.deps
# Object output directory.
obj := $(builddir)/obj
abs_obj := $(abspath $(obj))
# We build up a list of every single one of the targets so we can slurp in the
# generated dependency rule Makefiles in one pass.
all_deps :=
CC.target ?= $(CC)
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= $(CXX)
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= $(LINK)
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
PLI.target ?= pli
# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= gcc
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= g++
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= $(CXX.host)
LDFLAGS.host ?= $(LDFLAGS_host)
AR.host ?= ar
PLI.host ?= pli
# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
# "leading spaces cannot appear in the text of the first argument as written.
# These characters can be put into the argument value by variable substitution."
empty :=
space := $(empty) $(empty)
# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
replace_spaces = $(subst $(space),?,$1)
unreplace_spaces = $(subst ?,$(space),$1)
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
# Flags to make gcc output dependency info. Note that you need to be
# careful here to use the flags that ccache and distcc can understand.
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = -MMD -MF $(depfile).raw
# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
# ccache or distcc lose the path to the target, so we convert a rule of
# the form:
# foobar.o: DEP1 DEP2
# into
# path/to/foobar.o: DEP1 DEP2
# (2) we want missing files not to cause us to fail to build.
# We want to rewrite
# foobar.o: DEP1 DEP2 \
# DEP3
# to
# DEP1:
# DEP2:
# DEP3:
# so if the files are missing, they're just considered phony rules.
# We have to do some pretty insane escaping to get those backslashes
# and dollar signs past make, the shell, and sed at the same time.
# Doesn't work with spaces, but that's fine: .d files have spaces in
# their names replaced with other characters.
define fixup_dep
# The depfile may not exist if the input file didn't have any #includes.
touch $(depfile).raw
# Fixup path as in (1).
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
# Add extra rules as in (2).
# We remove slashes and replace spaces with new lines;
# remove blank lines;
# delete the first line and append a colon to the remaining lines.
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
grep -v '^$$' |\
sed -e 1d -e 's|$$|:|' \
>> $(depfile)
rm $(depfile).raw
endef
# Command definitions:
# - cmd_foo is the actual command to run;
# - quiet_cmd_foo is the brief-output summary of the command.
quiet_cmd_cc = CC($(TOOLSET)) $@
cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c
quiet_cmd_cxx = CXX($(TOOLSET)) $@
cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c
quiet_cmd_objc = CXX($(TOOLSET)) $@
cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
quiet_cmd_objcxx = CXX($(TOOLSET)) $@
cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
# Commands for precompiled header files.
quiet_cmd_pch_c = CXX($(TOOLSET)) $@
cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_pch_cc = CXX($(TOOLSET)) $@
cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
quiet_cmd_pch_m = CXX($(TOOLSET)) $@
cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $<
quiet_cmd_pch_mm = CXX($(TOOLSET)) $@
cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $<
# gyp-mac-tool is written next to the root Makefile by gyp.
# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd
# already.
quiet_cmd_mac_tool = MACTOOL $(4) $<
cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@"
quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@
cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4)
quiet_cmd_infoplist = INFOPLIST $@
cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@"
quiet_cmd_touch = TOUCH $@
cmd_touch = touch $@
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
quiet_cmd_symlink = SYMLINK $@
cmd_symlink = ln -sf "$<" "$@"
quiet_cmd_alink = LIBTOOL-STATIC $@
cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
# Define an escape_quotes function to escape single quotes.
# This allows us to handle quotes properly as long as we always use
# use single quotes and escape_quotes.
escape_quotes = $(subst ','\'',$(1))
# This comment is here just to include a ' to unconfuse syntax highlighting.
# Define an escape_vars function to escape '$' variable syntax.
# This allows us to read/write command lines with shell variables (e.g.
# $LD_LIBRARY_PATH), without triggering make substitution.
escape_vars = $(subst $$,$$$$,$(1))
# Helper that expands to a shell command to echo a string exactly as it is in
# make. This uses printf instead of echo because printf's behaviour with respect
# to escape sequences is more portable than echo's across different shells
# (e.g., dash, bash).
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
# Helper to compare the command we're about to run against the command
# we logged the last time we ran the command. Produces an empty
# string (false) when the commands match.
# Tricky point: Make has no string-equality test function.
# The kernel uses the following, but it seems like it would have false
# positives, where one string reordered its arguments.
# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
# $(filter-out $(cmd_$@), $(cmd_$(1))))
# We instead substitute each for the empty string into the other, and
# say they're equal if both substitutions produce the empty string.
# .d files contain ? instead of spaces, take that into account.
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
$(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
# Helper that is non-empty when a prerequisite changes.
# Normally make does this implicitly, but we force rules to always run
# so we can check their command lines.
# $? -- new prerequisites
# $| -- order-only dependencies
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
# Helper that executes all postbuilds until one fails.
define do_postbuilds
@E=0;\
for p in $(POSTBUILDS); do\
eval $$p;\
E=$$?;\
if [ $$E -ne 0 ]; then\
break;\
fi;\
done;\
if [ $$E -ne 0 ]; then\
rm -rf "$@";\
exit $$E;\
fi
endef
# do_cmd: run a command via the above cmd_foo names, if necessary.
# Should always run for a given target to handle command-line changes.
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
# Third argument, if non-zero, makes it do POSTBUILDS processing.
# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
# spaces already and dirx strips the ? characters.
define do_cmd
$(if $(or $(command_changed),$(prereq_changed)),
@$(call exact_echo, $($(quiet)cmd_$(1)))
@mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
$(if $(findstring flock,$(word 2,$(cmd_$1))),
@$(cmd_$(1))
@echo " $(quiet_cmd_$(1)): Finished",
@$(cmd_$(1))
)
@$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
@$(if $(2),$(fixup_dep))
$(if $(and $(3), $(POSTBUILDS)),
$(call do_postbuilds)
)
)
endef
# Declare the "all" target first so it is the default,
# even though we don't have the deps yet.
.PHONY: all
all:
# make looks for ways to re-generate included makefiles, but in our case, we
# don't have a direct way. Explicitly telling make that it has nothing to do
# for them makes it go faster.
%.d: ;
# Use FORCE_DO_CMD to force a target to run. Should be coupled with
# do_cmd.
.PHONY: FORCE_DO_CMD
FORCE_DO_CMD:
TOOLSET := target
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD
@$(call do_cmd,objc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD
@$(call do_cmd,objcxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD
@$(call do_cmd,objc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD
@$(call do_cmd,objcxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD
@$(call do_cmd,objc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD
@$(call do_cmd,objcxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,cpufeatures.target.mk)))),)
include cpufeatures.target.mk
endif
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,deps/cpu_features/cpu_features.target.mk)))),)
include deps/cpu_features/cpu_features.target.mk
endif
quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/spw/Library/Caches/node-gyp/20.6.1" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/spw/Library/Caches/node-gyp/20.6.1/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/spw/Documents/GitHub/sunpeiwen/node_modules/cpu-features" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/spw/Documents/GitHub/sunpeiwen/node_modules/cpu-features/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/common.gypi "--toplevel-dir=." binding.gyp
Makefile: $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/deps/cpu_features/cpu_features.gyp $(srcdir)/../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/buildcheck.gypi $(srcdir)/../../../../../Library/Caches/node-gyp/20.6.1/include/node/common.gypi
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included
# sub-makefiles. This is just here to clarify.
all:
# Add in dependency-tracking rules. $(all_deps) is the list of every single
# target in our tree. Only consider the ones with .d (dependency) info:
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
ifneq ($(d_files),)
include $(d_files)
endif

View File

@ -0,0 +1 @@
cmd_Release/cpu_features.a := rm -f Release/cpu_features.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/cpu_features.a Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o

View File

@ -0,0 +1 @@
cmd_Release/cpufeatures.node := c++ -bundle -undefined dynamic_lookup -Wl,-search_paths_first -mmacosx-version-min=10.15 -arch x86_64 -L./Release -stdlib=libc++ -o Release/cpufeatures.node Release/obj.target/cpufeatures/src/binding.o Release/cpu_features.a

View File

@ -0,0 +1,8 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o ../deps/cpu_features/src/filesystem.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o: \
../deps/cpu_features/src/filesystem.c \
../deps/cpu_features/include/internal/filesystem.h \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/filesystem.c:
../deps/cpu_features/include/internal/filesystem.h:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o ../deps/cpu_features/src/impl_aarch64_linux_or_android.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o: \
../deps/cpu_features/src/impl_aarch64_linux_or_android.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_aarch64_linux_or_android.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o ../deps/cpu_features/src/impl_aarch64_macos_or_iphone.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o: \
../deps/cpu_features/src/impl_aarch64_macos_or_iphone.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_aarch64_macos_or_iphone.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o ../deps/cpu_features/src/impl_arm_linux_or_android.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o: \
../deps/cpu_features/src/impl_arm_linux_or_android.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_arm_linux_or_android.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o ../deps/cpu_features/src/impl_mips_linux_or_android.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o: \
../deps/cpu_features/src/impl_mips_linux_or_android.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_mips_linux_or_android.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o ../deps/cpu_features/src/impl_ppc_linux.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o: \
../deps/cpu_features/src/impl_ppc_linux.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_ppc_linux.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o ../deps/cpu_features/src/impl_x86_freebsd.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o: \
../deps/cpu_features/src/impl_x86_freebsd.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_x86_freebsd.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o ../deps/cpu_features/src/impl_x86_linux_or_android.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o: \
../deps/cpu_features/src/impl_x86_linux_or_android.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_x86_linux_or_android.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,22 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o ../deps/cpu_features/src/impl_x86_macos.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o: \
../deps/cpu_features/src/impl_x86_macos.c \
../deps/cpu_features/include/cpu_features_macros.h \
../deps/cpu_features/src/impl_x86__base_implementation.inl \
../deps/cpu_features/src/copy.inl \
../deps/cpu_features/include/cpuinfo_x86.h \
../deps/cpu_features/include/cpu_features_cache_info.h \
../deps/cpu_features/src/equals.inl \
../deps/cpu_features/include/internal/bit_utils.h \
../deps/cpu_features/include/internal/cpuid_x86.h \
../deps/cpu_features/src/define_introspection.inl
../deps/cpu_features/src/impl_x86_macos.c:
../deps/cpu_features/include/cpu_features_macros.h:
../deps/cpu_features/src/impl_x86__base_implementation.inl:
../deps/cpu_features/src/copy.inl:
../deps/cpu_features/include/cpuinfo_x86.h:
../deps/cpu_features/include/cpu_features_cache_info.h:
../deps/cpu_features/src/equals.inl:
../deps/cpu_features/include/internal/bit_utils.h:
../deps/cpu_features/include/internal/cpuid_x86.h:
../deps/cpu_features/src/define_introspection.inl:

View File

@ -0,0 +1,6 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o ../deps/cpu_features/src/impl_x86_windows.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o: \
../deps/cpu_features/src/impl_x86_windows.c \
../deps/cpu_features/include/cpu_features_macros.h
../deps/cpu_features/src/impl_x86_windows.c:
../deps/cpu_features/include/cpu_features_macros.h:

View File

@ -0,0 +1,12 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o ../deps/cpu_features/src/stack_line_reader.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o: \
../deps/cpu_features/src/stack_line_reader.c \
../deps/cpu_features/include/internal/stack_line_reader.h \
../deps/cpu_features/include/cpu_features_macros.h \
../deps/cpu_features/include/internal/string_view.h \
../deps/cpu_features/include/internal/filesystem.h
../deps/cpu_features/src/stack_line_reader.c:
../deps/cpu_features/include/internal/stack_line_reader.h:
../deps/cpu_features/include/cpu_features_macros.h:
../deps/cpu_features/include/internal/string_view.h:
../deps/cpu_features/include/internal/filesystem.h:

View File

@ -0,0 +1,11 @@
cmd_Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o := cc -o Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o ../deps/cpu_features/src/string_view.c '-DNODE_GYP_MODULE_NAME=cpu_features' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DNDEBUG' '-DSTACK_LINE_READER_BUFFER_SIZE=1024' '-DHAVE_SYSCTLBYNAME=1' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../deps/cpu_features/include -I../deps/cpu_features/include/internal -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o.d.raw -c
Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o: \
../deps/cpu_features/src/string_view.c \
../deps/cpu_features/include/internal/string_view.h \
../deps/cpu_features/include/cpu_features_macros.h \
../deps/cpu_features/src/copy.inl ../deps/cpu_features/src/equals.inl
../deps/cpu_features/src/string_view.c:
../deps/cpu_features/include/internal/string_view.h:
../deps/cpu_features/include/cpu_features_macros.h:
../deps/cpu_features/src/copy.inl:
../deps/cpu_features/src/equals.inl:

View File

@ -0,0 +1,157 @@
cmd_Release/obj.target/cpufeatures/src/binding.o := c++ -o Release/obj.target/cpufeatures/src/binding.o ../src/binding.cc '-DNODE_GYP_MODULE_NAME=cpufeatures' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DCPU_FEATURES_VERSION_REV=8a494eb1e158ec2050e5f699a504fbc9b896a43b' '-DBUILDING_NODE_EXTENSION' -I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node -I/Users/spw/Library/Caches/node-gyp/20.6.1/src -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib -I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include -I../src -I../../nan -I../deps/cpu_features/include -O3 -gdwarf-2 -flto -mmacosx-version-min=10.15 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++17 -stdlib=libc++ -fno-rtti -fno-exceptions -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/cpufeatures/src/binding.o.d.raw -c
Release/obj.target/cpufeatures/src/binding.o: ../src/binding.cc \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/cppgc/common.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8config.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-array-buffer.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-local-handle.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-internal.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-version.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-object.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-maybe.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-persistent-handle.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-weak-callback-info.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-primitive.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-data.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-value.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-traced-handle.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-container.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-context.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-snapshot.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-date.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-debug.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-script.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-callbacks.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-promise.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-message.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-exception.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-extension.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-external.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-function.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-function-callback.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-template.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-memory-span.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-initialization.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-isolate.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-embedder-heap.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-microtask.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-statistics.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-unwinder.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-embedder-state-scope.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-platform.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-json.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-locker.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-microtask-queue.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-primitive-object.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-proxy.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-regexp.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-typed-array.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-value-serializer.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-wasm.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_version.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_api.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/js_native_api.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/js_native_api_types.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_api_types.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_buffer.h \
../../nan/nan.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/errno.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/version.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/unix.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/threadpool.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/darwin.h \
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_object_wrap.h \
../../nan/nan_callbacks.h ../../nan/nan_callbacks_12_inl.h \
../../nan/nan_maybe_43_inl.h ../../nan/nan_converters.h \
../../nan/nan_converters_43_inl.h ../../nan/nan_new.h \
../../nan/nan_implementation_12_inl.h \
../../nan/nan_persistent_12_inl.h ../../nan/nan_weak.h \
../../nan/nan_object_wrap.h ../../nan/nan_private.h \
../../nan/nan_typedarray_contents.h ../../nan/nan_json.h \
../../nan/nan_scriptorigin.h \
../deps/cpu_features/include/cpu_features_macros.h \
../deps/cpu_features/include/cpuinfo_x86.h \
../deps/cpu_features/include/cpu_features_cache_info.h
../src/binding.cc:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/cppgc/common.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8config.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-array-buffer.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-local-handle.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-internal.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-version.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-object.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-maybe.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-persistent-handle.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-weak-callback-info.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-primitive.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-data.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-value.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-traced-handle.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-container.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-context.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-snapshot.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-date.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-debug.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-script.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-callbacks.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-promise.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-message.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-exception.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-extension.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-external.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-function.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-function-callback.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-template.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-memory-span.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-initialization.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-isolate.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-embedder-heap.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-microtask.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-statistics.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-unwinder.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-embedder-state-scope.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-platform.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-json.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-locker.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-microtask-queue.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-primitive-object.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-proxy.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-regexp.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-typed-array.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-value-serializer.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/v8-wasm.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_version.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_api.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/js_native_api.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/js_native_api_types.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_api_types.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_buffer.h:
../../nan/nan.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/errno.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/version.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/unix.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/threadpool.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/uv/darwin.h:
/Users/spw/Library/Caches/node-gyp/20.6.1/include/node/node_object_wrap.h:
../../nan/nan_callbacks.h:
../../nan/nan_callbacks_12_inl.h:
../../nan/nan_maybe_43_inl.h:
../../nan/nan_converters.h:
../../nan/nan_converters_43_inl.h:
../../nan/nan_new.h:
../../nan/nan_implementation_12_inl.h:
../../nan/nan_persistent_12_inl.h:
../../nan/nan_weak.h:
../../nan/nan_object_wrap.h:
../../nan/nan_private.h:
../../nan/nan_typedarray_contents.h:
../../nan/nan_json.h:
../../nan/nan_scriptorigin.h:
../deps/cpu_features/include/cpu_features_macros.h:
../deps/cpu_features/include/cpuinfo_x86.h:
../deps/cpu_features/include/cpu_features_cache_info.h:

BIN
node_modules/cpu-features/build/Release/cpu_features.a generated vendored Normal file

Binary file not shown.

BIN
node_modules/cpu-features/build/Release/cpufeatures.node generated vendored Executable file

Binary file not shown.

Binary file not shown.

6
node_modules/cpu-features/build/binding.Makefile generated vendored Normal file
View File

@ -0,0 +1,6 @@
# This file is generated by gyp; do not edit.
export builddir_name ?= ./build/.
.PHONY: all
all:
$(MAKE) cpufeatures

418
node_modules/cpu-features/build/config.gypi generated vendored Normal file
View File

@ -0,0 +1,418 @@
# Do not edit. File was generated by node-gyp's "configure" step
{
"target_defaults": {
"cflags": [],
"default_configuration": "Release",
"defines": [],
"include_dirs": [],
"libraries": []
},
"variables": {
"asan": 0,
"coverage": "false",
"dcheck_always_on": 0,
"debug_nghttp2": "false",
"debug_node": "false",
"enable_lto": "true",
"enable_pgo_generate": "false",
"enable_pgo_use": "false",
"error_on_warn": "false",
"force_dynamic_crt": 0,
"host_arch": "x64",
"icu_gyp_path": "tools/icu/icu-system.gyp",
"icu_small": "false",
"icu_ver_major": "73",
"is_debug": 0,
"libdir": "lib",
"llvm_version": "14.0",
"napi_build_version": "9",
"node_builtin_shareable_builtins": [
"deps/cjs-module-lexer/lexer.js",
"deps/cjs-module-lexer/dist/lexer.js",
"deps/undici/undici.js"
],
"node_byteorder": "little",
"node_debug_lib": "false",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false",
"node_fipsinstall": "false",
"node_install_corepack": "false",
"node_install_npm": "false",
"node_library_files": [
"lib/_http_agent.js",
"lib/_http_client.js",
"lib/_http_common.js",
"lib/_http_incoming.js",
"lib/_http_outgoing.js",
"lib/_http_server.js",
"lib/_stream_duplex.js",
"lib/_stream_passthrough.js",
"lib/_stream_readable.js",
"lib/_stream_transform.js",
"lib/_stream_wrap.js",
"lib/_stream_writable.js",
"lib/_tls_common.js",
"lib/_tls_wrap.js",
"lib/assert.js",
"lib/assert/strict.js",
"lib/async_hooks.js",
"lib/buffer.js",
"lib/child_process.js",
"lib/cluster.js",
"lib/console.js",
"lib/constants.js",
"lib/crypto.js",
"lib/dgram.js",
"lib/diagnostics_channel.js",
"lib/dns.js",
"lib/dns/promises.js",
"lib/domain.js",
"lib/events.js",
"lib/fs.js",
"lib/fs/promises.js",
"lib/http.js",
"lib/http2.js",
"lib/https.js",
"lib/inspector.js",
"lib/inspector/promises.js",
"lib/internal/abort_controller.js",
"lib/internal/assert.js",
"lib/internal/assert/assertion_error.js",
"lib/internal/assert/calltracker.js",
"lib/internal/async_hooks.js",
"lib/internal/blob.js",
"lib/internal/blocklist.js",
"lib/internal/bootstrap/node.js",
"lib/internal/bootstrap/realm.js",
"lib/internal/bootstrap/switches/does_not_own_process_state.js",
"lib/internal/bootstrap/switches/does_own_process_state.js",
"lib/internal/bootstrap/switches/is_main_thread.js",
"lib/internal/bootstrap/switches/is_not_main_thread.js",
"lib/internal/bootstrap/web/exposed-wildcard.js",
"lib/internal/bootstrap/web/exposed-window-or-worker.js",
"lib/internal/buffer.js",
"lib/internal/child_process.js",
"lib/internal/child_process/serialization.js",
"lib/internal/cli_table.js",
"lib/internal/cluster/child.js",
"lib/internal/cluster/primary.js",
"lib/internal/cluster/round_robin_handle.js",
"lib/internal/cluster/shared_handle.js",
"lib/internal/cluster/utils.js",
"lib/internal/cluster/worker.js",
"lib/internal/console/constructor.js",
"lib/internal/console/global.js",
"lib/internal/constants.js",
"lib/internal/crypto/aes.js",
"lib/internal/crypto/certificate.js",
"lib/internal/crypto/cfrg.js",
"lib/internal/crypto/cipher.js",
"lib/internal/crypto/diffiehellman.js",
"lib/internal/crypto/ec.js",
"lib/internal/crypto/hash.js",
"lib/internal/crypto/hashnames.js",
"lib/internal/crypto/hkdf.js",
"lib/internal/crypto/keygen.js",
"lib/internal/crypto/keys.js",
"lib/internal/crypto/mac.js",
"lib/internal/crypto/pbkdf2.js",
"lib/internal/crypto/random.js",
"lib/internal/crypto/rsa.js",
"lib/internal/crypto/scrypt.js",
"lib/internal/crypto/sig.js",
"lib/internal/crypto/util.js",
"lib/internal/crypto/webcrypto.js",
"lib/internal/crypto/webidl.js",
"lib/internal/crypto/x509.js",
"lib/internal/debugger/inspect.js",
"lib/internal/debugger/inspect_client.js",
"lib/internal/debugger/inspect_repl.js",
"lib/internal/dgram.js",
"lib/internal/dns/callback_resolver.js",
"lib/internal/dns/promises.js",
"lib/internal/dns/utils.js",
"lib/internal/encoding.js",
"lib/internal/error_serdes.js",
"lib/internal/errors.js",
"lib/internal/event_target.js",
"lib/internal/events/symbols.js",
"lib/internal/file.js",
"lib/internal/fixed_queue.js",
"lib/internal/freelist.js",
"lib/internal/freeze_intrinsics.js",
"lib/internal/fs/cp/cp-sync.js",
"lib/internal/fs/cp/cp.js",
"lib/internal/fs/dir.js",
"lib/internal/fs/promises.js",
"lib/internal/fs/read/context.js",
"lib/internal/fs/read/utf8.js",
"lib/internal/fs/recursive_watch.js",
"lib/internal/fs/rimraf.js",
"lib/internal/fs/streams.js",
"lib/internal/fs/sync_write_stream.js",
"lib/internal/fs/utils.js",
"lib/internal/fs/watchers.js",
"lib/internal/heap_utils.js",
"lib/internal/histogram.js",
"lib/internal/http.js",
"lib/internal/http2/compat.js",
"lib/internal/http2/core.js",
"lib/internal/http2/util.js",
"lib/internal/idna.js",
"lib/internal/inspector_async_hook.js",
"lib/internal/js_stream_socket.js",
"lib/internal/legacy/processbinding.js",
"lib/internal/linkedlist.js",
"lib/internal/main/check_syntax.js",
"lib/internal/main/embedding.js",
"lib/internal/main/eval_stdin.js",
"lib/internal/main/eval_string.js",
"lib/internal/main/inspect.js",
"lib/internal/main/mksnapshot.js",
"lib/internal/main/print_help.js",
"lib/internal/main/prof_process.js",
"lib/internal/main/repl.js",
"lib/internal/main/run_main_module.js",
"lib/internal/main/test_runner.js",
"lib/internal/main/watch_mode.js",
"lib/internal/main/worker_thread.js",
"lib/internal/mime.js",
"lib/internal/modules/cjs/loader.js",
"lib/internal/modules/esm/assert.js",
"lib/internal/modules/esm/create_dynamic_module.js",
"lib/internal/modules/esm/fetch_module.js",
"lib/internal/modules/esm/formats.js",
"lib/internal/modules/esm/get_format.js",
"lib/internal/modules/esm/handle_process_exit.js",
"lib/internal/modules/esm/hooks.js",
"lib/internal/modules/esm/initialize_import_meta.js",
"lib/internal/modules/esm/load.js",
"lib/internal/modules/esm/loader.js",
"lib/internal/modules/esm/module_job.js",
"lib/internal/modules/esm/module_map.js",
"lib/internal/modules/esm/package_config.js",
"lib/internal/modules/esm/resolve.js",
"lib/internal/modules/esm/shared_constants.js",
"lib/internal/modules/esm/translators.js",
"lib/internal/modules/esm/utils.js",
"lib/internal/modules/esm/worker.js",
"lib/internal/modules/helpers.js",
"lib/internal/modules/package_json_reader.js",
"lib/internal/modules/run_main.js",
"lib/internal/net.js",
"lib/internal/options.js",
"lib/internal/per_context/domexception.js",
"lib/internal/per_context/messageport.js",
"lib/internal/per_context/primordials.js",
"lib/internal/perf/event_loop_delay.js",
"lib/internal/perf/event_loop_utilization.js",
"lib/internal/perf/nodetiming.js",
"lib/internal/perf/observe.js",
"lib/internal/perf/performance.js",
"lib/internal/perf/performance_entry.js",
"lib/internal/perf/resource_timing.js",
"lib/internal/perf/timerify.js",
"lib/internal/perf/usertiming.js",
"lib/internal/perf/utils.js",
"lib/internal/policy/manifest.js",
"lib/internal/policy/sri.js",
"lib/internal/priority_queue.js",
"lib/internal/process/esm_loader.js",
"lib/internal/process/execution.js",
"lib/internal/process/per_thread.js",
"lib/internal/process/permission.js",
"lib/internal/process/policy.js",
"lib/internal/process/pre_execution.js",
"lib/internal/process/promises.js",
"lib/internal/process/report.js",
"lib/internal/process/signal.js",
"lib/internal/process/task_queues.js",
"lib/internal/process/warning.js",
"lib/internal/process/worker_thread_only.js",
"lib/internal/promise_hooks.js",
"lib/internal/querystring.js",
"lib/internal/readline/callbacks.js",
"lib/internal/readline/emitKeypressEvents.js",
"lib/internal/readline/interface.js",
"lib/internal/readline/promises.js",
"lib/internal/readline/utils.js",
"lib/internal/repl.js",
"lib/internal/repl/await.js",
"lib/internal/repl/history.js",
"lib/internal/repl/utils.js",
"lib/internal/socket_list.js",
"lib/internal/socketaddress.js",
"lib/internal/source_map/prepare_stack_trace.js",
"lib/internal/source_map/source_map.js",
"lib/internal/source_map/source_map_cache.js",
"lib/internal/stream_base_commons.js",
"lib/internal/streams/add-abort-signal.js",
"lib/internal/streams/buffer_list.js",
"lib/internal/streams/compose.js",
"lib/internal/streams/destroy.js",
"lib/internal/streams/duplex.js",
"lib/internal/streams/duplexify.js",
"lib/internal/streams/end-of-stream.js",
"lib/internal/streams/from.js",
"lib/internal/streams/lazy_transform.js",
"lib/internal/streams/legacy.js",
"lib/internal/streams/operators.js",
"lib/internal/streams/passthrough.js",
"lib/internal/streams/pipeline.js",
"lib/internal/streams/readable.js",
"lib/internal/streams/state.js",
"lib/internal/streams/transform.js",
"lib/internal/streams/utils.js",
"lib/internal/streams/writable.js",
"lib/internal/structured_clone.js",
"lib/internal/test/binding.js",
"lib/internal/test/transfer.js",
"lib/internal/test_runner/coverage.js",
"lib/internal/test_runner/harness.js",
"lib/internal/test_runner/mock/mock.js",
"lib/internal/test_runner/mock/mock_timers.js",
"lib/internal/test_runner/reporter/dot.js",
"lib/internal/test_runner/reporter/spec.js",
"lib/internal/test_runner/reporter/tap.js",
"lib/internal/test_runner/reporter/v8-serializer.js",
"lib/internal/test_runner/runner.js",
"lib/internal/test_runner/test.js",
"lib/internal/test_runner/tests_stream.js",
"lib/internal/test_runner/utils.js",
"lib/internal/timers.js",
"lib/internal/tls/secure-context.js",
"lib/internal/tls/secure-pair.js",
"lib/internal/trace_events_async_hooks.js",
"lib/internal/tty.js",
"lib/internal/url.js",
"lib/internal/util.js",
"lib/internal/util/colors.js",
"lib/internal/util/comparisons.js",
"lib/internal/util/debuglog.js",
"lib/internal/util/embedding.js",
"lib/internal/util/inspect.js",
"lib/internal/util/inspector.js",
"lib/internal/util/iterable_weak_map.js",
"lib/internal/util/parse_args/parse_args.js",
"lib/internal/util/parse_args/utils.js",
"lib/internal/util/types.js",
"lib/internal/v8/startup_snapshot.js",
"lib/internal/v8_prof_polyfill.js",
"lib/internal/v8_prof_processor.js",
"lib/internal/validators.js",
"lib/internal/vm.js",
"lib/internal/vm/module.js",
"lib/internal/wasm_web_api.js",
"lib/internal/watch_mode/files_watcher.js",
"lib/internal/watchdog.js",
"lib/internal/webidl.js",
"lib/internal/webstreams/adapters.js",
"lib/internal/webstreams/compression.js",
"lib/internal/webstreams/encoding.js",
"lib/internal/webstreams/queuingstrategies.js",
"lib/internal/webstreams/readablestream.js",
"lib/internal/webstreams/transfer.js",
"lib/internal/webstreams/transformstream.js",
"lib/internal/webstreams/util.js",
"lib/internal/webstreams/writablestream.js",
"lib/internal/worker.js",
"lib/internal/worker/io.js",
"lib/internal/worker/js_transferable.js",
"lib/module.js",
"lib/net.js",
"lib/os.js",
"lib/path.js",
"lib/path/posix.js",
"lib/path/win32.js",
"lib/perf_hooks.js",
"lib/process.js",
"lib/punycode.js",
"lib/querystring.js",
"lib/readline.js",
"lib/readline/promises.js",
"lib/repl.js",
"lib/stream.js",
"lib/stream/consumers.js",
"lib/stream/promises.js",
"lib/stream/web.js",
"lib/string_decoder.js",
"lib/sys.js",
"lib/test.js",
"lib/test/reporters.js",
"lib/timers.js",
"lib/timers/promises.js",
"lib/tls.js",
"lib/trace_events.js",
"lib/tty.js",
"lib/url.js",
"lib/util.js",
"lib/util/types.js",
"lib/v8.js",
"lib/vm.js",
"lib/wasi.js",
"lib/worker_threads.js",
"lib/zlib.js"
],
"node_module_version": 115,
"node_no_browser_globals": "false",
"node_prefix": "/usr/local/Cellar/node/20.6.1",
"node_release_urlbase": "",
"node_shared": "false",
"node_shared_brotli": "true",
"node_shared_cares": "true",
"node_shared_http_parser": "false",
"node_shared_libuv": "true",
"node_shared_nghttp2": "true",
"node_shared_nghttp3": "false",
"node_shared_ngtcp2": "false",
"node_shared_openssl": "true",
"node_shared_zlib": "true",
"node_tag": "",
"node_target_type": "executable",
"node_use_bundled_v8": "true",
"node_use_node_code_cache": "true",
"node_use_node_snapshot": "true",
"node_use_openssl": "true",
"node_use_v8_platform": "true",
"node_with_ltcg": "false",
"node_without_node_options": "false",
"openssl_is_fips": "false",
"openssl_quic": "false",
"ossfuzz": "false",
"shlib_suffix": "115.dylib",
"single_executable_application": "true",
"target_arch": "x64",
"v8_enable_31bit_smis_on_64bit_arch": 0,
"v8_enable_gdbjit": 0,
"v8_enable_hugepage": 0,
"v8_enable_i18n_support": 1,
"v8_enable_inspector": 1,
"v8_enable_javascript_promise_hooks": 1,
"v8_enable_lite_mode": 0,
"v8_enable_object_print": 1,
"v8_enable_pointer_compression": 0,
"v8_enable_shared_ro_heap": 1,
"v8_enable_short_builtin_calls": 1,
"v8_enable_webassembly": 1,
"v8_no_strict_aliasing": 1,
"v8_optimized_debug": 1,
"v8_promise_internal_field_count": 1,
"v8_random_seed": 0,
"v8_trace_maps": 0,
"v8_use_siphash": 1,
"want_separate_host_toolset": 0,
"nodedir": "/Users/spw/Library/Caches/node-gyp/20.6.1",
"standalone_static_library": 1,
"metrics_registry": "https://registry.npmjs.org/",
"global_prefix": "/usr/local",
"local_prefix": "/Users/spw/Documents/GitHub/sunpeiwen",
"globalconfig": "/usr/local/etc/npmrc",
"init_module": "/Users/spw/.npm-init.js",
"userconfig": "/Users/spw/.npmrc",
"npm_version": "9.8.1",
"node_gyp": "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",
"cache": "/Users/spw/.npm",
"user_agent": "npm/9.8.1 node/v20.6.1 darwin x64 workspaces/false",
"prefix": "/usr/local"
}
}

196
node_modules/cpu-features/build/cpufeatures.target.mk generated vendored Normal file
View File

@ -0,0 +1,196 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := cpufeatures
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=cpufeatures' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DCPU_FEATURES_VERSION_REV=8a494eb1e158ec2050e5f699a504fbc9b896a43b' \
'-DBUILDING_NODE_EXTENSION' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-O0 \
-gdwarf-2 \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-Wall \
-Wendif-labels \
-W \
-Wno-unused-parameter
# Flags passed to only C files.
CFLAGS_C_Debug := \
-fno-strict-aliasing
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-std=gnu++17 \
-stdlib=libc++ \
-fno-rtti \
-fno-exceptions \
-fno-strict-aliasing
# Flags passed to only ObjC files.
CFLAGS_OBJC_Debug :=
# Flags passed to only ObjC++ files.
CFLAGS_OBJCC_Debug :=
INCS_Debug := \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/src \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include \
-I$(srcdir)/src \
-I$(srcdir)/../nan \
-I$(srcdir)/deps/cpu_features/include
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=cpufeatures' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DCPU_FEATURES_VERSION_REV=8a494eb1e158ec2050e5f699a504fbc9b896a43b' \
'-DBUILDING_NODE_EXTENSION'
# Flags passed to all source files.
CFLAGS_Release := \
-O3 \
-gdwarf-2 \
-flto \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-Wall \
-Wendif-labels \
-W \
-Wno-unused-parameter
# Flags passed to only C files.
CFLAGS_C_Release := \
-fno-strict-aliasing
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-std=gnu++17 \
-stdlib=libc++ \
-fno-rtti \
-fno-exceptions \
-fno-strict-aliasing
# Flags passed to only ObjC files.
CFLAGS_OBJC_Release :=
# Flags passed to only ObjC++ files.
CFLAGS_OBJCC_Release :=
INCS_Release := \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/src \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include \
-I$(srcdir)/src \
-I$(srcdir)/../nan \
-I$(srcdir)/deps/cpu_features/include
OBJS := \
$(obj).target/$(TARGET)/src/binding.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# Make sure our dependencies are built before any of us.
$(OBJS): | $(builddir)/cpu_features.a
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-undefined dynamic_lookup \
-Wl,-search_paths_first \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-L$(builddir) \
-stdlib=libc++
LIBTOOLFLAGS_Debug := \
-undefined dynamic_lookup \
-Wl,-search_paths_first
LDFLAGS_Release := \
-undefined dynamic_lookup \
-Wl,-search_paths_first \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-L$(builddir) \
-stdlib=libc++
LIBTOOLFLAGS_Release := \
-undefined dynamic_lookup \
-Wl,-search_paths_first
LIBS :=
$(builddir)/cpufeatures.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(builddir)/cpufeatures.node: LIBS := $(LIBS)
$(builddir)/cpufeatures.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
$(builddir)/cpufeatures.node: TOOLSET := $(TOOLSET)
$(builddir)/cpufeatures.node: $(OBJS) $(builddir)/cpu_features.a FORCE_DO_CMD
$(call do_cmd,solink_module)
all_deps += $(builddir)/cpufeatures.node
# Add target alias
.PHONY: cpufeatures
cpufeatures: $(builddir)/cpufeatures.node
# Short alias for building this executable.
.PHONY: cpufeatures.node
cpufeatures.node: $(builddir)/cpufeatures.node
# Add executable to "all" target.
.PHONY: all
all: $(builddir)/cpufeatures.node

View File

@ -0,0 +1,6 @@
# This file is generated by gyp; do not edit.
export builddir_name ?= ./build/deps/cpu_features/.
.PHONY: all
all:
$(MAKE) -C ../.. cpu_features

View File

@ -0,0 +1,204 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := cpu_features
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=cpu_features' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DNDEBUG' \
'-DSTACK_LINE_READER_BUFFER_SIZE=1024' \
'-DHAVE_SYSCTLBYNAME=1' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-O0 \
-gdwarf-2 \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-Wall \
-Wendif-labels \
-W \
-Wno-unused-parameter
# Flags passed to only C files.
CFLAGS_C_Debug := \
-fno-strict-aliasing
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-std=gnu++17 \
-stdlib=libc++ \
-fno-rtti \
-fno-exceptions \
-fno-strict-aliasing
# Flags passed to only ObjC files.
CFLAGS_OBJC_Debug :=
# Flags passed to only ObjC++ files.
CFLAGS_OBJCC_Debug :=
INCS_Debug := \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/src \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include \
-I$(srcdir)/deps/cpu_features/include \
-I$(srcdir)/deps/cpu_features/include/internal
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=cpu_features' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-D_DARWIN_USE_64_BIT_INODE=1' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DNDEBUG' \
'-DSTACK_LINE_READER_BUFFER_SIZE=1024' \
'-DHAVE_SYSCTLBYNAME=1'
# Flags passed to all source files.
CFLAGS_Release := \
-O3 \
-gdwarf-2 \
-flto \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-Wall \
-Wendif-labels \
-W \
-Wno-unused-parameter
# Flags passed to only C files.
CFLAGS_C_Release := \
-fno-strict-aliasing
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-std=gnu++17 \
-stdlib=libc++ \
-fno-rtti \
-fno-exceptions \
-fno-strict-aliasing
# Flags passed to only ObjC files.
CFLAGS_OBJC_Release :=
# Flags passed to only ObjC++ files.
CFLAGS_OBJCC_Release :=
INCS_Release := \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/include/node \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/src \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/config \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/openssl/openssl/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/uv/include \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/zlib \
-I/Users/spw/Library/Caches/node-gyp/20.6.1/deps/v8/include \
-I$(srcdir)/deps/cpu_features/include \
-I$(srcdir)/deps/cpu_features/include/internal
OBJS := \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_aarch64_linux_or_android.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_arm_linux_or_android.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_mips_linux_or_android.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_ppc_linux.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_x86_freebsd.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_x86_linux_or_android.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_x86_macos.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/impl_x86_windows.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/filesystem.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/stack_line_reader.o \
$(obj).target/$(TARGET)/deps/cpu_features/src/string_view.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE))
$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-L$(builddir) \
-stdlib=libc++
LIBTOOLFLAGS_Debug :=
LDFLAGS_Release := \
-mmacosx-version-min=10.15 \
-arch x86_64 \
-L$(builddir) \
-stdlib=libc++
LIBTOOLFLAGS_Release :=
LIBS :=
$(builddir)/cpu_features.a: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(builddir)/cpu_features.a: LIBS := $(LIBS)
$(builddir)/cpu_features.a: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))
$(builddir)/cpu_features.a: TOOLSET := $(TOOLSET)
$(builddir)/cpu_features.a: $(OBJS) FORCE_DO_CMD
$(call do_cmd,alink)
all_deps += $(builddir)/cpu_features.a
# Add target alias
.PHONY: cpu_features
cpu_features: $(builddir)/cpu_features.a
# Add target alias to "all" target.
.PHONY: all
all: cpu_features
# Add target alias
.PHONY: cpu_features
cpu_features: $(builddir)/cpu_features.a
# Short alias for building this static library.
.PHONY: cpu_features.a
cpu_features.a: $(builddir)/cpu_features.a
# Add static library to "all" target.
.PHONY: all
all: $(builddir)/cpu_features.a

772
node_modules/cpu-features/build/gyp-mac-tool generated vendored Executable file
View File

@ -0,0 +1,772 @@
#!/usr/bin/env python3
# Generated by gyp. Do not edit.
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
"""
import fcntl
import fnmatch
import glob
import json
import os
import plistlib
import re
import shutil
import struct
import subprocess
import sys
import tempfile
def main(args):
executor = MacTool()
exit_code = executor.Dispatch(args)
if exit_code is not None:
sys.exit(exit_code)
class MacTool:
"""This class performs all the Mac tooling steps. The methods can either be
executed directly, or dispatched from an argument list."""
def Dispatch(self, args):
"""Dispatches a string command to a method."""
if len(args) < 1:
raise Exception("Not enough arguments")
method = "Exec%s" % self._CommandifyName(args[0])
return getattr(self, method)(*args[1:])
def _CommandifyName(self, name_string):
"""Transforms a tool name like copy-info-plist to CopyInfoPlist"""
return name_string.title().replace("-", "")
def ExecCopyBundleResource(self, source, dest, convert_to_binary):
"""Copies a resource file to the bundle/Resources directory, performing any
necessary compilation on each resource."""
convert_to_binary = convert_to_binary == "True"
extension = os.path.splitext(source)[1].lower()
if os.path.isdir(source):
# Copy tree.
# TODO(thakis): This copies file attributes like mtime, while the
# single-file branch below doesn't. This should probably be changed to
# be consistent with the single-file branch.
if os.path.exists(dest):
shutil.rmtree(dest)
shutil.copytree(source, dest)
elif extension == ".xib":
return self._CopyXIBFile(source, dest)
elif extension == ".storyboard":
return self._CopyXIBFile(source, dest)
elif extension == ".strings" and not convert_to_binary:
self._CopyStringsFile(source, dest)
else:
if os.path.exists(dest):
os.unlink(dest)
shutil.copy(source, dest)
if convert_to_binary and extension in (".plist", ".strings"):
self._ConvertToBinary(dest)
def _CopyXIBFile(self, source, dest):
"""Compiles a XIB file with ibtool into a binary plist in the bundle."""
# ibtool sometimes crashes with relative paths. See crbug.com/314728.
base = os.path.dirname(os.path.realpath(__file__))
if os.path.relpath(source):
source = os.path.join(base, source)
if os.path.relpath(dest):
dest = os.path.join(base, dest)
args = ["xcrun", "ibtool", "--errors", "--warnings", "--notices"]
if os.environ["XCODE_VERSION_ACTUAL"] > "0700":
args.extend(["--auto-activate-custom-fonts"])
if "IPHONEOS_DEPLOYMENT_TARGET" in os.environ:
args.extend(
[
"--target-device",
"iphone",
"--target-device",
"ipad",
"--minimum-deployment-target",
os.environ["IPHONEOS_DEPLOYMENT_TARGET"],
]
)
else:
args.extend(
[
"--target-device",
"mac",
"--minimum-deployment-target",
os.environ["MACOSX_DEPLOYMENT_TARGET"],
]
)
args.extend(
["--output-format", "human-readable-text", "--compile", dest, source]
)
ibtool_section_re = re.compile(r"/\*.*\*/")
ibtool_re = re.compile(r".*note:.*is clipping its content")
try:
stdout = subprocess.check_output(args)
except subprocess.CalledProcessError as e:
print(e.output)
raise
current_section_header = None
for line in stdout.splitlines():
if ibtool_section_re.match(line):
current_section_header = line
elif not ibtool_re.match(line):
if current_section_header:
print(current_section_header)
current_section_header = None
print(line)
return 0
def _ConvertToBinary(self, dest):
subprocess.check_call(
["xcrun", "plutil", "-convert", "binary1", "-o", dest, dest]
)
def _CopyStringsFile(self, source, dest):
"""Copies a .strings file using iconv to reconvert the input into UTF-16."""
input_code = self._DetectInputEncoding(source) or "UTF-8"
# Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call
# CFPropertyListCreateFromXMLData() behind the scenes; at least it prints
# CFPropertyListCreateFromXMLData(): Old-style plist parser: missing
# semicolon in dictionary.
# on invalid files. Do the same kind of validation.
import CoreFoundation
with open(source, "rb") as in_file:
s = in_file.read()
d = CoreFoundation.CFDataCreate(None, s, len(s))
_, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None)
if error:
return
with open(dest, "wb") as fp:
fp.write(s.decode(input_code).encode("UTF-16"))
def _DetectInputEncoding(self, file_name):
"""Reads the first few bytes from file_name and tries to guess the text
encoding. Returns None as a guess if it can't detect it."""
with open(file_name, "rb") as fp:
try:
header = fp.read(3)
except Exception:
return None
if header.startswith(b"\xFE\xFF"):
return "UTF-16"
elif header.startswith(b"\xFF\xFE"):
return "UTF-16"
elif header.startswith(b"\xEF\xBB\xBF"):
return "UTF-8"
else:
return None
def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys):
"""Copies the |source| Info.plist to the destination directory |dest|."""
# Read the source Info.plist into memory.
with open(source) as fd:
lines = fd.read()
# Insert synthesized key/value pairs (e.g. BuildMachineOSBuild).
plist = plistlib.readPlistFromString(lines)
if keys:
plist.update(json.loads(keys[0]))
lines = plistlib.writePlistToString(plist)
# Go through all the environment variables and replace them as variables in
# the file.
IDENT_RE = re.compile(r"[_/\s]")
for key in os.environ:
if key.startswith("_"):
continue
evar = "${%s}" % key
evalue = os.environ[key]
lines = lines.replace(lines, evar, evalue)
# Xcode supports various suffices on environment variables, which are
# all undocumented. :rfc1034identifier is used in the standard project
# template these days, and :identifier was used earlier. They are used to
# convert non-url characters into things that look like valid urls --
# except that the replacement character for :identifier, '_' isn't valid
# in a URL either -- oops, hence :rfc1034identifier was born.
evar = "${%s:identifier}" % key
evalue = IDENT_RE.sub("_", os.environ[key])
lines = lines.replace(lines, evar, evalue)
evar = "${%s:rfc1034identifier}" % key
evalue = IDENT_RE.sub("-", os.environ[key])
lines = lines.replace(lines, evar, evalue)
# Remove any keys with values that haven't been replaced.
lines = lines.splitlines()
for i in range(len(lines)):
if lines[i].strip().startswith("<string>${"):
lines[i] = None
lines[i - 1] = None
lines = "\n".join(line for line in lines if line is not None)
# Write out the file with variables replaced.
with open(dest, "w") as fd:
fd.write(lines)
# Now write out PkgInfo file now that the Info.plist file has been
# "compiled".
self._WritePkgInfo(dest)
if convert_to_binary == "True":
self._ConvertToBinary(dest)
def _WritePkgInfo(self, info_plist):
"""This writes the PkgInfo file from the data stored in Info.plist."""
plist = plistlib.readPlist(info_plist)
if not plist:
return
# Only create PkgInfo for executable types.
package_type = plist["CFBundlePackageType"]
if package_type != "APPL":
return
# The format of PkgInfo is eight characters, representing the bundle type
# and bundle signature, each four characters. If that is missing, four
# '?' characters are used instead.
signature_code = plist.get("CFBundleSignature", "????")
if len(signature_code) != 4: # Wrong length resets everything, too.
signature_code = "?" * 4
dest = os.path.join(os.path.dirname(info_plist), "PkgInfo")
with open(dest, "w") as fp:
fp.write(f"{package_type}{signature_code}")
def ExecFlock(self, lockfile, *cmd_list):
"""Emulates the most basic behavior of Linux's flock(1)."""
# Rely on exception handling to report errors.
fd = os.open(lockfile, os.O_RDONLY | os.O_NOCTTY | os.O_CREAT, 0o666)
fcntl.flock(fd, fcntl.LOCK_EX)
return subprocess.call(cmd_list)
def ExecFilterLibtool(self, *cmd_list):
"""Calls libtool and filters out '/path/to/libtool: file: foo.o has no
symbols'."""
libtool_re = re.compile(
r"^.*libtool: (?:for architecture: \S* )?" r"file: .* has no symbols$"
)
libtool_re5 = re.compile(
r"^.*libtool: warning for library: "
+ r".* the table of contents is empty "
+ r"\(no object file members in the library define global symbols\)$"
)
env = os.environ.copy()
# Ref:
# http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c
# The problem with this flag is that it resets the file mtime on the file to
# epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone.
env["ZERO_AR_DATE"] = "1"
libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env)
err = libtoolout.communicate()[1].decode("utf-8")
for line in err.splitlines():
if not libtool_re.match(line) and not libtool_re5.match(line):
print(line, file=sys.stderr)
# Unconditionally touch the output .a file on the command line if present
# and the command succeeded. A bit hacky.
if not libtoolout.returncode:
for i in range(len(cmd_list) - 1):
if cmd_list[i] == "-o" and cmd_list[i + 1].endswith(".a"):
os.utime(cmd_list[i + 1], None)
break
return libtoolout.returncode
def ExecPackageIosFramework(self, framework):
# Find the name of the binary based on the part before the ".framework".
binary = os.path.basename(framework).split(".")[0]
module_path = os.path.join(framework, "Modules")
if not os.path.exists(module_path):
os.mkdir(module_path)
module_template = (
"framework module %s {\n"
' umbrella header "%s.h"\n'
"\n"
" export *\n"
" module * { export * }\n"
"}\n" % (binary, binary)
)
with open(os.path.join(module_path, "module.modulemap"), "w") as module_file:
module_file.write(module_template)
def ExecPackageFramework(self, framework, version):
"""Takes a path to Something.framework and the Current version of that and
sets up all the symlinks."""
# Find the name of the binary based on the part before the ".framework".
binary = os.path.basename(framework).split(".")[0]
CURRENT = "Current"
RESOURCES = "Resources"
VERSIONS = "Versions"
if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)):
# Binary-less frameworks don't seem to contain symlinks (see e.g.
# chromium's out/Debug/org.chromium.Chromium.manifest/ bundle).
return
# Move into the framework directory to set the symlinks correctly.
pwd = os.getcwd()
os.chdir(framework)
# Set up the Current version.
self._Relink(version, os.path.join(VERSIONS, CURRENT))
# Set up the root symlinks.
self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary)
self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES)
# Back to where we were before!
os.chdir(pwd)
def _Relink(self, dest, link):
"""Creates a symlink to |dest| named |link|. If |link| already exists,
it is overwritten."""
if os.path.lexists(link):
os.remove(link)
os.symlink(dest, link)
def ExecCompileIosFrameworkHeaderMap(self, out, framework, *all_headers):
framework_name = os.path.basename(framework).split(".")[0]
all_headers = [os.path.abspath(header) for header in all_headers]
filelist = {}
for header in all_headers:
filename = os.path.basename(header)
filelist[filename] = header
filelist[os.path.join(framework_name, filename)] = header
WriteHmap(out, filelist)
def ExecCopyIosFrameworkHeaders(self, framework, *copy_headers):
header_path = os.path.join(framework, "Headers")
if not os.path.exists(header_path):
os.makedirs(header_path)
for header in copy_headers:
shutil.copy(header, os.path.join(header_path, os.path.basename(header)))
def ExecCompileXcassets(self, keys, *inputs):
"""Compiles multiple .xcassets files into a single .car file.
This invokes 'actool' to compile all the inputs .xcassets files. The
|keys| arguments is a json-encoded dictionary of extra arguments to
pass to 'actool' when the asset catalogs contains an application icon
or a launch image.
Note that 'actool' does not create the Assets.car file if the asset
catalogs does not contains imageset.
"""
command_line = [
"xcrun",
"actool",
"--output-format",
"human-readable-text",
"--compress-pngs",
"--notices",
"--warnings",
"--errors",
]
is_iphone_target = "IPHONEOS_DEPLOYMENT_TARGET" in os.environ
if is_iphone_target:
platform = os.environ["CONFIGURATION"].split("-")[-1]
if platform not in ("iphoneos", "iphonesimulator"):
platform = "iphonesimulator"
command_line.extend(
[
"--platform",
platform,
"--target-device",
"iphone",
"--target-device",
"ipad",
"--minimum-deployment-target",
os.environ["IPHONEOS_DEPLOYMENT_TARGET"],
"--compile",
os.path.abspath(os.environ["CONTENTS_FOLDER_PATH"]),
]
)
else:
command_line.extend(
[
"--platform",
"macosx",
"--target-device",
"mac",
"--minimum-deployment-target",
os.environ["MACOSX_DEPLOYMENT_TARGET"],
"--compile",
os.path.abspath(os.environ["UNLOCALIZED_RESOURCES_FOLDER_PATH"]),
]
)
if keys:
keys = json.loads(keys)
for key, value in keys.items():
arg_name = "--" + key
if isinstance(value, bool):
if value:
command_line.append(arg_name)
elif isinstance(value, list):
for v in value:
command_line.append(arg_name)
command_line.append(str(v))
else:
command_line.append(arg_name)
command_line.append(str(value))
# Note: actool crashes if inputs path are relative, so use os.path.abspath
# to get absolute path name for inputs.
command_line.extend(map(os.path.abspath, inputs))
subprocess.check_call(command_line)
def ExecMergeInfoPlist(self, output, *inputs):
"""Merge multiple .plist files into a single .plist file."""
merged_plist = {}
for path in inputs:
plist = self._LoadPlistMaybeBinary(path)
self._MergePlist(merged_plist, plist)
plistlib.writePlist(merged_plist, output)
def ExecCodeSignBundle(self, key, entitlements, provisioning, path, preserve):
"""Code sign a bundle.
This function tries to code sign an iOS bundle, following the same
algorithm as Xcode:
1. pick the provisioning profile that best match the bundle identifier,
and copy it into the bundle as embedded.mobileprovision,
2. copy Entitlements.plist from user or SDK next to the bundle,
3. code sign the bundle.
"""
substitutions, overrides = self._InstallProvisioningProfile(
provisioning, self._GetCFBundleIdentifier()
)
entitlements_path = self._InstallEntitlements(
entitlements, substitutions, overrides
)
args = ["codesign", "--force", "--sign", key]
if preserve == "True":
args.extend(["--deep", "--preserve-metadata=identifier,entitlements"])
else:
args.extend(["--entitlements", entitlements_path])
args.extend(["--timestamp=none", path])
subprocess.check_call(args)
def _InstallProvisioningProfile(self, profile, bundle_identifier):
"""Installs embedded.mobileprovision into the bundle.
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Returns:
A tuple containing two dictionary: variables substitutions and values
to overrides when generating the entitlements file.
"""
source_path, provisioning_data, team_id = self._FindProvisioningProfile(
profile, bundle_identifier
)
target_path = os.path.join(
os.environ["BUILT_PRODUCTS_DIR"],
os.environ["CONTENTS_FOLDER_PATH"],
"embedded.mobileprovision",
)
shutil.copy2(source_path, target_path)
substitutions = self._GetSubstitutions(bundle_identifier, team_id + ".")
return substitutions, provisioning_data["Entitlements"]
def _FindProvisioningProfile(self, profile, bundle_identifier):
"""Finds the .mobileprovision file to use for signing the bundle.
Checks all the installed provisioning profiles (or if the user specified
the PROVISIONING_PROFILE variable, only consult it) and select the most
specific that correspond to the bundle identifier.
Args:
profile: string, optional, short name of the .mobileprovision file
to use, if empty or the file is missing, the best file installed
will be used
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
Returns:
A tuple of the path to the selected provisioning profile, the data of
the embedded plist in the provisioning profile and the team identifier
to use for code signing.
Raises:
SystemExit: if no .mobileprovision can be used to sign the bundle.
"""
profiles_dir = os.path.join(
os.environ["HOME"], "Library", "MobileDevice", "Provisioning Profiles"
)
if not os.path.isdir(profiles_dir):
print(
"cannot find mobile provisioning for %s" % (bundle_identifier),
file=sys.stderr,
)
sys.exit(1)
provisioning_profiles = None
if profile:
profile_path = os.path.join(profiles_dir, profile + ".mobileprovision")
if os.path.exists(profile_path):
provisioning_profiles = [profile_path]
if not provisioning_profiles:
provisioning_profiles = glob.glob(
os.path.join(profiles_dir, "*.mobileprovision")
)
valid_provisioning_profiles = {}
for profile_path in provisioning_profiles:
profile_data = self._LoadProvisioningProfile(profile_path)
app_id_pattern = profile_data.get("Entitlements", {}).get(
"application-identifier", ""
)
for team_identifier in profile_data.get("TeamIdentifier", []):
app_id = f"{team_identifier}.{bundle_identifier}"
if fnmatch.fnmatch(app_id, app_id_pattern):
valid_provisioning_profiles[app_id_pattern] = (
profile_path,
profile_data,
team_identifier,
)
if not valid_provisioning_profiles:
print(
"cannot find mobile provisioning for %s" % (bundle_identifier),
file=sys.stderr,
)
sys.exit(1)
# If the user has multiple provisioning profiles installed that can be
# used for ${bundle_identifier}, pick the most specific one (ie. the
# provisioning profile whose pattern is the longest).
selected_key = max(valid_provisioning_profiles, key=lambda v: len(v))
return valid_provisioning_profiles[selected_key]
def _LoadProvisioningProfile(self, profile_path):
"""Extracts the plist embedded in a provisioning profile.
Args:
profile_path: string, path to the .mobileprovision file
Returns:
Content of the plist embedded in the provisioning profile as a dictionary.
"""
with tempfile.NamedTemporaryFile() as temp:
subprocess.check_call(
["security", "cms", "-D", "-i", profile_path, "-o", temp.name]
)
return self._LoadPlistMaybeBinary(temp.name)
def _MergePlist(self, merged_plist, plist):
"""Merge |plist| into |merged_plist|."""
for key, value in plist.items():
if isinstance(value, dict):
merged_value = merged_plist.get(key, {})
if isinstance(merged_value, dict):
self._MergePlist(merged_value, value)
merged_plist[key] = merged_value
else:
merged_plist[key] = value
else:
merged_plist[key] = value
def _LoadPlistMaybeBinary(self, plist_path):
"""Loads into a memory a plist possibly encoded in binary format.
This is a wrapper around plistlib.readPlist that tries to convert the
plist to the XML format if it can't be parsed (assuming that it is in
the binary format).
Args:
plist_path: string, path to a plist file, in XML or binary format
Returns:
Content of the plist as a dictionary.
"""
try:
# First, try to read the file using plistlib that only supports XML,
# and if an exception is raised, convert a temporary copy to XML and
# load that copy.
return plistlib.readPlist(plist_path)
except Exception:
pass
with tempfile.NamedTemporaryFile() as temp:
shutil.copy2(plist_path, temp.name)
subprocess.check_call(["plutil", "-convert", "xml1", temp.name])
return plistlib.readPlist(temp.name)
def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix):
"""Constructs a dictionary of variable substitutions for Entitlements.plist.
Args:
bundle_identifier: string, value of CFBundleIdentifier from Info.plist
app_identifier_prefix: string, value for AppIdentifierPrefix
Returns:
Dictionary of substitutions to apply when generating Entitlements.plist.
"""
return {
"CFBundleIdentifier": bundle_identifier,
"AppIdentifierPrefix": app_identifier_prefix,
}
def _GetCFBundleIdentifier(self):
"""Extracts CFBundleIdentifier value from Info.plist in the bundle.
Returns:
Value of CFBundleIdentifier in the Info.plist located in the bundle.
"""
info_plist_path = os.path.join(
os.environ["TARGET_BUILD_DIR"], os.environ["INFOPLIST_PATH"]
)
info_plist_data = self._LoadPlistMaybeBinary(info_plist_path)
return info_plist_data["CFBundleIdentifier"]
def _InstallEntitlements(self, entitlements, substitutions, overrides):
"""Generates and install the ${BundleName}.xcent entitlements file.
Expands variables "$(variable)" pattern in the source entitlements file,
add extra entitlements defined in the .mobileprovision file and the copy
the generated plist to "${BundlePath}.xcent".
Args:
entitlements: string, optional, path to the Entitlements.plist template
to use, defaults to "${SDKROOT}/Entitlements.plist"
substitutions: dictionary, variable substitutions
overrides: dictionary, values to add to the entitlements
Returns:
Path to the generated entitlements file.
"""
source_path = entitlements
target_path = os.path.join(
os.environ["BUILT_PRODUCTS_DIR"], os.environ["PRODUCT_NAME"] + ".xcent"
)
if not source_path:
source_path = os.path.join(os.environ["SDKROOT"], "Entitlements.plist")
shutil.copy2(source_path, target_path)
data = self._LoadPlistMaybeBinary(target_path)
data = self._ExpandVariables(data, substitutions)
if overrides:
for key in overrides:
if key not in data:
data[key] = overrides[key]
plistlib.writePlist(data, target_path)
return target_path
def _ExpandVariables(self, data, substitutions):
"""Expands variables "$(variable)" in data.
Args:
data: object, can be either string, list or dictionary
substitutions: dictionary, variable substitutions to perform
Returns:
Copy of data where each references to "$(variable)" has been replaced
by the corresponding value found in substitutions, or left intact if
the key was not found.
"""
if isinstance(data, str):
for key, value in substitutions.items():
data = data.replace("$(%s)" % key, value)
return data
if isinstance(data, list):
return [self._ExpandVariables(v, substitutions) for v in data]
if isinstance(data, dict):
return {k: self._ExpandVariables(data[k], substitutions) for k in data}
return data
def NextGreaterPowerOf2(x):
return 2 ** (x).bit_length()
def WriteHmap(output_name, filelist):
"""Generates a header map based on |filelist|.
Per Mark Mentovai:
A header map is structured essentially as a hash table, keyed by names used
in #includes, and providing pathnames to the actual files.
The implementation below and the comment above comes from inspecting:
http://www.opensource.apple.com/source/distcc/distcc-2503/distcc_dist/include_server/headermap.py?txt
while also looking at the implementation in clang in:
https://llvm.org/svn/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp
"""
magic = 1751998832
version = 1
_reserved = 0
count = len(filelist)
capacity = NextGreaterPowerOf2(count)
strings_offset = 24 + (12 * capacity)
max_value_length = max(len(value) for value in filelist.values())
out = open(output_name, "wb")
out.write(
struct.pack(
"<LHHLLLL",
magic,
version,
_reserved,
strings_offset,
count,
capacity,
max_value_length,
)
)
# Create empty hashmap buckets.
buckets = [None] * capacity
for file, path in filelist.items():
key = 0
for c in file:
key += ord(c.lower()) * 13
# Fill next empty bucket.
while buckets[key & capacity - 1] is not None:
key = key + 1
buckets[key & capacity - 1] = (file, path)
next_offset = 1
for bucket in buckets:
if bucket is None:
out.write(struct.pack("<LLL", 0, 0, 0))
else:
(file, path) = bucket
key_offset = next_offset
prefix_offset = key_offset + len(file) + 1
suffix_offset = prefix_offset + len(os.path.dirname(path) + os.sep) + 1
next_offset = suffix_offset + len(os.path.basename(path)) + 1
out.write(struct.pack("<LLL", key_offset, prefix_offset, suffix_offset))
# Pad byte since next offset starts at 1.
out.write(struct.pack("<x"))
for bucket in buckets:
if bucket is not None:
(file, path) = bucket
out.write(struct.pack("<%ds" % len(file), file))
out.write(struct.pack("<s", "\0"))
base = os.path.dirname(path) + os.sep
out.write(struct.pack("<%ds" % len(base), base))
out.write(struct.pack("<s", "\0"))
path = os.path.basename(path)
out.write(struct.pack("<%ds" % len(path), path))
out.write(struct.pack("<s", "\0"))
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))

1
node_modules/cpu-features/build/node_gyp_bins/python3 generated vendored Symbolic link
View File

@ -0,0 +1 @@
/Library/Developer/CommandLineTools/usr/bin/python3

17
node_modules/cpu-features/buildcheck.gypi generated vendored Normal file
View File

@ -0,0 +1,17 @@
{
"conditions": [
[
"OS!=\"win\" and target_arch not in \"ia32 x32 x64\"",
{
"defines": [
"HAVE_DLFCN_H=1"
],
"libraries": [],
"sources": [
"deps/cpu_features/include/internal/hwcaps.h",
"deps/cpu_features/src/hwcaps.c"
]
}
]
]
}

32
node_modules/cpu-features/buildcheck.js generated vendored Normal file
View File

@ -0,0 +1,32 @@
'use strict';
const BuildEnvironment = require('buildcheck');
const be = new BuildEnvironment();
let gyp = {
defines: [],
libraries: [],
sources: [
'deps/cpu_features/include/internal/hwcaps.h',
'deps/cpu_features/src/hwcaps.c',
],
};
be.checkHeader('c', 'dlfcn.h');
if (be.checkDeclared('c', 'getauxval', { headers: ['sys/auxv.h'] }))
gyp.defines.push('HAVE_STRONG_GETAUXVAL=1');
// Add the things we detected
gyp.defines.push(...be.defines(null, true));
gyp.libraries.push(...be.libs());
gyp = {
conditions: [
['OS!="win" and target_arch not in "ia32 x32 x64"',
gyp],
],
};
console.log(JSON.stringify(gyp, null, 2));

View File

@ -0,0 +1,4 @@
---
Language: Cpp
BasedOnStyle: Google
...

View File

@ -0,0 +1,31 @@
# Project Files unneeded by docker
cmake/ci/Makefile
cmake/ci/docker
cmake/ci/doc
cmake/ci/cache
.git
.gitignore
.github
.dockerignore
.clang-format
appveyor.yml
.travis.yml
AUTHORS
CONTRIBUTING.md
CONTRIBUTORS
LICENSE
README.md
build/
cmake_build/
build_cross/
cmake-build-*/
out/
# Editor directories and files
.idea/
.vagrant/
.vscode/
.vs/
*.user
*.swp

View File

@ -0,0 +1,5 @@
# Create a virtual environment with all tools installed
# ref: https://hub.docker.com/_/alpine
FROM alpine:edge
# Install system build dependencies
RUN apk add --no-cache git clang-extra-tools

View File

@ -0,0 +1,30 @@
name: AArch64 Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [
[aarch64],
[aarch64be],
[aarch64-linux-gnu],
[aarch64_be-linux-gnu]
]
fail-fast: false
env:
TARGET: ${{ matrix.targets[0] }}
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -0,0 +1,22 @@
name: amd64 FreeBSD CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Only MacOS hosted runner provides virtualisation with vagrant/virtualbox installed.
# see: https://github.com/actions/virtual-environments/tree/main/images/macos
make:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: vagrant version
run: Vagrant --version
- name: VirtualBox version
run: virtualbox -h
- name: Build
run: cd cmake/ci/vagrant/freebsd && vagrant up

View File

@ -0,0 +1,26 @@
name: amd64 Linux Bazel
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
bazel:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Install Bazel
run: |
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt-get update
sudo apt-get install bazel
bazel --version
- name: Test
run: bazel test -s --verbose_failures //...

View File

@ -0,0 +1,31 @@
name: amd64 Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Env
run: make --directory=cmake/ci amd64_env
- name: Devel
run: make --directory=cmake/ci amd64_devel
- name: Build
run: make --directory=cmake/ci amd64_build
- name: Test
run: make --directory=cmake/ci amd64_test
- name: Install Env
run: make --directory=cmake/ci amd64_install_env
- name: Install Devel
run: make --directory=cmake/ci amd64_install_devel
- name: Install Build
run: make --directory=cmake/ci amd64_install_build
- name: Install Test
run: make --directory=cmake/ci amd64_install_test

View File

@ -0,0 +1,43 @@
name: amd64 MacOS CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
xcode:
runs-on: macos-latest
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -G "Xcode" -DCMAKE_CONFIGURATION_TYPES=Release
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -v
- name: Test
run: cmake --build build --config Release --target RUN_TESTS -v
- name: Install
run: cmake --build build --config Release --target install -v
make:
runs-on: macos-latest
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v2
- name: Check cmake
run: cmake --version
- name: Configure
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --target all -v
- name: Test
run: cmake --build build --target test -v
- name: Install
run: cmake --build build --target install -v

View File

@ -0,0 +1,25 @@
name: amd64 Windows CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
msvc:
runs-on: windows-latest
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v2
- name: Configure
run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES=Release
- name: Build
run: cmake --build build --config Release --target ALL_BUILD -- /maxcpucount
- name: Test
run: cmake --build build --config Release --target RUN_TESTS -- /maxcpucount
- name: Install
run: cmake --build build --config Release --target INSTALL -- /maxcpucount

View File

@ -0,0 +1,31 @@
name: ARM Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [
[arm-linux-gnueabihf],
[armv8l-linux-gnueabihf],
[arm-linux-gnueabi],
[armeb-linux-gnueabihf],
[armeb-linux-gnueabi]
]
fail-fast: false
env:
TARGET: ${{ matrix.targets[0] }}
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -0,0 +1,24 @@
name: clang-format Check
on: [push, pull_request]
jobs:
# Building using the github runner environement directly.
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch origin/main
run: git fetch origin main
- name: List of changed file(s)
run: git diff --name-only FETCH_HEAD
- name: Build clang-format docker
run: cd .github/workflows && docker build --tag=linter .
- name: Check clang-format
run: docker run --rm --init -v $(pwd):/repo linter:latest clang-format --version
- name: clang-format help
run: docker run --rm --init -v $(pwd):/repo linter:latest clang-format --help
- name: Check current commit
run: docker run --rm --init -v $(pwd):/repo -w /repo linter:latest sh -c "git diff --diff-filter=d --name-only FETCH_HEAD | grep '\.c$\|\.h$\|\.cc$' | xargs clang-format --style=file --dry-run --Werror "

View File

@ -0,0 +1,30 @@
name: MIPS Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [
[mips32],
[mips32el],
[mips64],
[mips64el]
]
fail-fast: false
env:
TARGET: ${{ matrix.targets[0] }}
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -0,0 +1,29 @@
name: POWER Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [
[ppc],
[ppc64],
[ppc64le],
]
fail-fast: false
env:
TARGET: ${{ matrix.targets[0] }}
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -0,0 +1,28 @@
name: RISCV Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [
[riscv32],
[riscv64],
]
fail-fast: false
env:
TARGET: ${{ matrix.targets[0] }}
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -0,0 +1,27 @@
name: s390x Linux CMake
on:
push:
pull_request:
schedule:
# min hours day(month) month day(week)
- cron: '0 0 7,22 * *'
jobs:
# Building using the github runner environement directly.
make:
runs-on: ubuntu-latest
strategy:
matrix:
targets: [
[s390x],
]
fail-fast: false
env:
TARGET: ${{ matrix.targets[0] }}
steps:
- uses: actions/checkout@v2
- name: Build
run: make --directory=cmake/ci ${TARGET}_build
- name: Test
run: make --directory=cmake/ci ${TARGET}_test

View File

@ -0,0 +1,21 @@
---
dataSource: "prs"
ignoreLabels:
- "Apple M1"
- "duplicate"
- "help wanted"
- "invalid"
- "question"
- "wontfix"
onlyMilestones: false
groupBy:
"API Change":
- "API Change"
"New features / Enhancements":
- "enhancement"
- "internal"
"Bug Fixes":
- "bug"
"Misc":
- "misc"
changelogFilename: "CHANGELOG.md"

19
node_modules/cpu-features/deps/cpu_features/.npmignore generated vendored Normal file
View File

@ -0,0 +1,19 @@
# Build folders
build/
cmake_build/
build_cross/
cmake-build-*/
out/
# IDEs / CI temp files
.idea/
.vagrant/
.vscode/
.vs/
*.swp
# Bazel artifacts
**/bazel-*
# Per-user bazelrc files
user.bazelrc

329
node_modules/cpu-features/deps/cpu_features/BUILD.bazel generated vendored Normal file
View File

@ -0,0 +1,329 @@
# cpu_features, a cross platform C99 library to get cpu features at runtime.
load("@bazel_skylib//lib:selects.bzl", "selects")
load("//:bazel/platforms.bzl", "PLATFORM_CPU_ARM", "PLATFORM_CPU_ARM64", "PLATFORM_CPU_MIPS", "PLATFORM_CPU_PPC", "PLATFORM_CPU_X86_64")
package(
default_visibility = ["//visibility:public"],
licenses = ["notice"],
)
exports_files(["LICENSE"])
INCLUDES = ["include"]
C99_FLAGS = [
"-std=c99",
"-Wall",
"-Wextra",
"-Wmissing-declarations",
"-Wmissing-prototypes",
"-Wno-implicit-fallthrough",
"-Wno-unused-function",
"-Wold-style-definition",
"-Wshadow",
"-Wsign-compare",
"-Wstrict-prototypes",
]
cc_library(
name = "cpu_features_macros",
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = ["include/cpu_features_macros.h"],
)
cc_library(
name = "cpu_features_cache_info",
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = ["include/cpu_features_cache_info.h"],
deps = [":cpu_features_macros"],
)
cc_library(
name = "bit_utils",
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = ["include/internal/bit_utils.h"],
deps = [":cpu_features_macros"],
)
cc_test(
name = "bit_utils_test",
srcs = ["test/bit_utils_test.cc"],
includes = INCLUDES,
deps = [
":bit_utils",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "memory_utils",
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = [
"src/copy.inl",
"src/equals.inl",
],
)
cc_library(
name = "string_view",
srcs = [
"src/string_view.c",
],
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = ["include/internal/string_view.h"],
deps = [
":cpu_features_macros",
":memory_utils",
],
)
cc_test(
name = "string_view_test",
srcs = ["test/string_view_test.cc"],
includes = INCLUDES,
deps = [
":string_view",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "filesystem",
srcs = ["src/filesystem.c"],
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = ["include/internal/filesystem.h"],
deps = [":cpu_features_macros"],
)
cc_library(
name = "filesystem_for_testing",
testonly = 1,
srcs = [
"src/filesystem.c",
"test/filesystem_for_testing.cc",
],
hdrs = [
"include/internal/filesystem.h",
"test/filesystem_for_testing.h",
],
defines = ["CPU_FEATURES_MOCK_FILESYSTEM"],
includes = INCLUDES,
deps = [
":cpu_features_macros",
],
)
cc_library(
name = "stack_line_reader",
srcs = ["src/stack_line_reader.c"],
copts = C99_FLAGS,
defines = ["STACK_LINE_READER_BUFFER_SIZE=1024"],
includes = INCLUDES,
textual_hdrs = ["include/internal/stack_line_reader.h"],
deps = [
":cpu_features_macros",
":filesystem",
":string_view",
],
)
cc_test(
name = "stack_line_reader_test",
srcs = [
"include/internal/stack_line_reader.h",
"src/stack_line_reader.c",
"test/stack_line_reader_test.cc",
],
defines = ["STACK_LINE_READER_BUFFER_SIZE=16"],
includes = INCLUDES,
deps = [
":cpu_features_macros",
":filesystem_for_testing",
":string_view",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "stack_line_reader_to_use_with_filesystem_for_testing",
testonly = 1,
srcs = ["src/stack_line_reader.c"],
hdrs = ["include/internal/stack_line_reader.h"],
copts = C99_FLAGS,
defines = ["STACK_LINE_READER_BUFFER_SIZE=1024"],
includes = INCLUDES,
deps = [
":cpu_features_macros",
":filesystem_for_testing",
":string_view",
],
)
cc_library(
name = "hwcaps",
srcs = ["src/hwcaps.c"],
copts = C99_FLAGS,
defines = ["HAVE_STRONG_GETAUXVAL"],
includes = INCLUDES,
textual_hdrs = ["include/internal/hwcaps.h"],
deps = [
":cpu_features_macros",
":filesystem",
":string_view",
],
)
cc_library(
name = "hwcaps_for_testing",
testonly = 1,
srcs = [
"src/hwcaps.c",
"test/hwcaps_for_testing.cc",
],
hdrs = [
"include/internal/hwcaps.h",
"test/hwcaps_for_testing.h",
],
defines = [
"CPU_FEATURES_MOCK_GET_ELF_HWCAP_FROM_GETAUXVAL",
"CPU_FEATURES_TEST",
],
includes = INCLUDES,
deps = [
":cpu_features_macros",
":filesystem_for_testing",
":string_view",
],
)
cc_library(
name = "cpuinfo",
srcs = selects.with_or({
PLATFORM_CPU_X86_64: [
"src/impl_x86_freebsd.c",
"src/impl_x86_linux_or_android.c",
"src/impl_x86_macos.c",
"src/impl_x86_windows.c",
],
PLATFORM_CPU_ARM: ["src/impl_arm_linux_or_android.c"],
PLATFORM_CPU_ARM64: ["src/impl_aarch64_linux_or_android.c"],
PLATFORM_CPU_MIPS: ["src/impl_mips_linux_or_android.c"],
PLATFORM_CPU_PPC: ["src/impl_ppc_linux.c"],
}),
copts = C99_FLAGS,
includes = INCLUDES,
textual_hdrs = selects.with_or({
PLATFORM_CPU_X86_64: [
"src/impl_x86__base_implementation.inl",
"include/cpuinfo_x86.h",
"include/internal/cpuid_x86.h",
"include/internal/windows_utils.h",
],
PLATFORM_CPU_ARM: ["include/cpuinfo_arm.h"],
PLATFORM_CPU_ARM64: ["include/cpuinfo_aarch64.h"],
PLATFORM_CPU_MIPS: ["include/cpuinfo_mips.h"],
PLATFORM_CPU_PPC: ["include/cpuinfo_ppc.h"],
}) + [
"src/define_introspection.inl",
"src/define_introspection_and_hwcaps.inl",
],
deps = [
":bit_utils",
":cpu_features_cache_info",
":cpu_features_macros",
":filesystem",
":hwcaps",
":memory_utils",
":stack_line_reader",
":string_view",
],
)
cc_library(
name = "cpuinfo_for_testing",
testonly = 1,
srcs = selects.with_or({
PLATFORM_CPU_X86_64: [
"src/impl_x86_freebsd.c",
"src/impl_x86_linux_or_android.c",
"src/impl_x86_macos.c",
"src/impl_x86_windows.c",
],
PLATFORM_CPU_ARM: ["src/impl_arm_linux_or_android.c"],
PLATFORM_CPU_ARM64: ["src/impl_aarch64_linux_or_android.c"],
PLATFORM_CPU_MIPS: ["src/impl_mips_linux_or_android.c"],
PLATFORM_CPU_PPC: ["src/impl_ppc_linux.c"],
}),
hdrs = selects.with_or({
PLATFORM_CPU_X86_64: [
"include/cpuinfo_x86.h",
"include/internal/cpuid_x86.h",
"include/internal/windows_utils.h",
],
PLATFORM_CPU_ARM: ["include/cpuinfo_arm.h"],
PLATFORM_CPU_ARM64: ["include/cpuinfo_aarch64.h"],
PLATFORM_CPU_MIPS: ["include/cpuinfo_mips.h"],
PLATFORM_CPU_PPC: ["include/cpuinfo_ppc.h"],
}),
copts = C99_FLAGS,
defines = selects.with_or({
PLATFORM_CPU_X86_64: ["CPU_FEATURES_MOCK_CPUID_X86"],
"//conditions:default": [],
}),
includes = INCLUDES,
textual_hdrs = selects.with_or({
PLATFORM_CPU_X86_64: ["src/impl_x86__base_implementation.inl"],
"//conditions:default": [],
}) + [
"src/define_introspection.inl",
"src/define_introspection_and_hwcaps.inl",
],
deps = [
":bit_utils",
":cpu_features_cache_info",
":cpu_features_macros",
":filesystem_for_testing",
":hwcaps_for_testing",
":memory_utils",
":stack_line_reader_to_use_with_filesystem_for_testing",
":string_view",
],
)
cc_test(
name = "cpuinfo_test",
srcs = selects.with_or({
PLATFORM_CPU_ARM64: ["test/cpuinfo_aarch64_test.cc"],
PLATFORM_CPU_ARM: ["test/cpuinfo_arm_test.cc"],
PLATFORM_CPU_MIPS: ["test/cpuinfo_mips_test.cc"],
PLATFORM_CPU_PPC: ["test/cpuinfo_ppc_test.cc"],
PLATFORM_CPU_X86_64: ["test/cpuinfo_x86_test.cc"],
}),
includes = INCLUDES,
deps = [
":cpuinfo_for_testing",
":filesystem_for_testing",
":hwcaps_for_testing",
":string_view",
"@com_google_googletest//:gtest_main",
],
)
cc_binary(
name = "list_cpu_features",
srcs = ["src/utils/list_cpu_features.c"],
copts = C99_FLAGS,
includes = INCLUDES,
deps = [
":bit_utils",
":cpu_features_macros",
":cpuinfo",
],
)

View File

@ -0,0 +1,261 @@
cmake_minimum_required(VERSION 3.19.2)
# option() honors normal variables.
# see: https://cmake.org/cmake/help/git-stage/policy/CMP0077.html
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
project(CpuFeatures VERSION 0.8.0 LANGUAGES C)
set(CMAKE_C_STANDARD 99)
# Default Build Type to be Release
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make
# it prominent in the GUI.
# cpu_features uses bit-fields which are - to some extends - implementation-defined (see https://en.cppreference.com/w/c/language/bit_field).
# As a consequence it is discouraged to use cpu_features as a shared library because different compilers may interpret the code in different ways.
# Prefer static linking from source whenever possible.
option(BUILD_SHARED_LIBS "Build library as shared." OFF)
# Force PIC on unix when building shared libs
# see: https://en.wikipedia.org/wiki/Position-independent_code
if(BUILD_SHARED_LIBS AND UNIX)
option(CMAKE_POSITION_INDEPENDENT_CODE "Build with Position Independant Code." ON)
endif()
include(CheckIncludeFile)
include(CheckSymbolExists)
include(GNUInstallDirs)
macro(setup_include_and_definitions TARGET_NAME)
target_include_directories(${TARGET_NAME}
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/internal>
)
target_compile_definitions(${TARGET_NAME}
PUBLIC STACK_LINE_READER_BUFFER_SIZE=1024
)
endmacro()
set(PROCESSOR_IS_MIPS FALSE)
set(PROCESSOR_IS_ARM FALSE)
set(PROCESSOR_IS_AARCH64 FALSE)
set(PROCESSOR_IS_X86 FALSE)
set(PROCESSOR_IS_POWER FALSE)
set(PROCESSOR_IS_S390X FALSE)
set(PROCESSOR_IS_RISCV FALSE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
set(PROCESSOR_IS_MIPS TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)")
set(PROCESSOR_IS_AARCH64 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
set(PROCESSOR_IS_ARM TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64|amd64)|(^i.86$)")
set(PROCESSOR_IS_X86 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)")
set(PROCESSOR_IS_POWER TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x)")
set(PROCESSOR_IS_S390X TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv")
set(PROCESSOR_IS_RISCV TRUE)
endif()
macro(add_cpu_features_headers_and_sources HDRS_LIST_NAME SRCS_LIST_NAME)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpu_features_macros.h)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpu_features_cache_info.h)
file(GLOB IMPL_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/impl_*.c")
list(APPEND ${SRCS_LIST_NAME} ${IMPL_SOURCES})
if(PROCESSOR_IS_MIPS)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_mips.h)
elseif(PROCESSOR_IS_ARM)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_arm.h)
elseif(PROCESSOR_IS_AARCH64)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_aarch64.h)
list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/windows_utils.h)
elseif(PROCESSOR_IS_X86)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_x86.h)
list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/cpuid_x86.h)
list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/windows_utils.h)
elseif(PROCESSOR_IS_POWER)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_ppc.h)
elseif(PROCESSOR_IS_S390X)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_s390x.h)
elseif(PROCESSOR_IS_RISCV)
list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_riscv.h)
else()
message(FATAL_ERROR "Unsupported architectures ${CMAKE_SYSTEM_PROCESSOR}")
endif()
endmacro()
#
# library : utils
#
add_library(utils OBJECT
${PROJECT_SOURCE_DIR}/include/internal/bit_utils.h
${PROJECT_SOURCE_DIR}/include/internal/filesystem.h
${PROJECT_SOURCE_DIR}/include/internal/stack_line_reader.h
${PROJECT_SOURCE_DIR}/include/internal/string_view.h
${PROJECT_SOURCE_DIR}/src/filesystem.c
${PROJECT_SOURCE_DIR}/src/stack_line_reader.c
${PROJECT_SOURCE_DIR}/src/string_view.c
)
setup_include_and_definitions(utils)
#
# library : unix_based_hardware_detection
#
if(UNIX)
add_library(unix_based_hardware_detection OBJECT
${PROJECT_SOURCE_DIR}/include/internal/hwcaps.h
${PROJECT_SOURCE_DIR}/src/hwcaps.c
)
setup_include_and_definitions(unix_based_hardware_detection)
check_include_file(dlfcn.h HAVE_DLFCN_H)
if(HAVE_DLFCN_H)
target_compile_definitions(unix_based_hardware_detection PRIVATE HAVE_DLFCN_H)
endif()
check_symbol_exists(getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL)
if(HAVE_STRONG_GETAUXVAL)
target_compile_definitions(unix_based_hardware_detection PRIVATE HAVE_STRONG_GETAUXVAL)
endif()
endif()
#
# library : cpu_features
#
set (CPU_FEATURES_HDRS)
set (CPU_FEATURES_SRCS)
add_cpu_features_headers_and_sources(CPU_FEATURES_HDRS CPU_FEATURES_SRCS)
list(APPEND CPU_FEATURES_SRCS $<TARGET_OBJECTS:utils>)
if(NOT PROCESSOR_IS_X86 AND UNIX)
list(APPEND CPU_FEATURES_SRCS $<TARGET_OBJECTS:unix_based_hardware_detection>)
endif()
add_library(cpu_features ${CPU_FEATURES_HDRS} ${CPU_FEATURES_SRCS})
set_target_properties(cpu_features PROPERTIES PUBLIC_HEADER "${CPU_FEATURES_HDRS}")
setup_include_and_definitions(cpu_features)
target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS})
target_include_directories(cpu_features
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/cpu_features>
)
if(PROCESSOR_IS_X86 OR PROCESSOR_IS_AARCH64)
if(APPLE)
target_compile_definitions(cpu_features PRIVATE HAVE_SYSCTLBYNAME)
endif()
endif()
add_library(CpuFeature::cpu_features ALIAS cpu_features)
#
# program : list_cpu_features
#
add_executable(list_cpu_features ${PROJECT_SOURCE_DIR}/src/utils/list_cpu_features.c)
target_link_libraries(list_cpu_features PRIVATE cpu_features)
add_executable(CpuFeature::list_cpu_features ALIAS list_cpu_features)
#
# ndk_compat
#
if(ANDROID)
add_subdirectory(ndk_compat)
endif()
#
# tests
#
include(CTest)
if(BUILD_TESTING)
# Automatically incorporate googletest into the CMake Project if target not
# found.
enable_language(CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # prefer use of -std14 instead of -gnustd14
if(NOT TARGET gtest OR NOT TARGET gmock_main)
# Download and unpack googletest at configure time.
configure_file(
cmake/googletest.CMakeLists.txt.in
googletest-download/CMakeLists.txt
)
execute_process(
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(
COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download)
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
# Prevent overriding the parent project's compiler/linker settings on
# Windows.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This defines the gtest and
# gtest_main targets.
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
endif()
add_subdirectory(test)
endif()
#
# Install cpu_features and list_cpu_features
#
include(GNUInstallDirs)
install(TARGETS cpu_features list_cpu_features
EXPORT CpuFeaturesTargets
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cpu_features
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(EXPORT CpuFeaturesTargets
NAMESPACE CpuFeatures::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/CpuFeatures
COMPONENT Devel
)
include(CMakePackageConfigHelpers)
configure_package_config_file(cmake/CpuFeaturesConfig.cmake.in
"${PROJECT_BINARY_DIR}/CpuFeaturesConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/CpuFeatures"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/CpuFeaturesConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
)
install(
FILES
"${PROJECT_BINARY_DIR}/CpuFeaturesConfig.cmake"
"${PROJECT_BINARY_DIR}/CpuFeaturesConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/CpuFeatures"
COMPONENT Devel
)

View File

@ -0,0 +1,23 @@
# How to Contribute
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Code reviews
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

230
node_modules/cpu-features/deps/cpu_features/LICENSE generated vendored Normal file
View File

@ -0,0 +1,230 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
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.
--------------------------------------------------------------------------------
For files in the `ndk_compat` folder:
--------------------------------------------------------------------------------
Copyright (C) 2010 The Android Open Source Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.

272
node_modules/cpu-features/deps/cpu_features/README.md generated vendored Normal file
View File

@ -0,0 +1,272 @@
# cpu_features
A cross-platform C library to retrieve CPU features (such as available
instructions) at runtime.
# GitHub-CI Status
[comment]: <> (The following lines are generated by "scripts/generate_badges.d" that you can run online https://run.dlang.io/)
| Os | amd64 | AArch64 | ARM | MIPS | POWER | RISCV | s390x |
| :-- | --: | --: | --: | --: | --: | --: | --: |
| Linux | [![][i1a0]][l1a0]<br/>[![][i1a1]][l1a1] | [![][i1b0]][l1b0]<br/>![][d1] | [![][i1c0]][l1c0]<br/>![][d1] | [![][i1d0]][l1d0]<br/>![][d1] | [![][i1e0]][l1e0]<br/>![][d1] | [![][i1f0]][l1f0]<br/>![][d1] | [![][i1g0]][l1g0]<br/>![][d1] |
| FreeBSD | [![][i2a0]][l2a0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] |
| MacOS | [![][i3a0]][l3a0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] |
| Windows | [![][i4a0]][l4a0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] | ![][d0]<br/>![][d1] |
[d0]: https://img.shields.io/badge/CMake-N%2FA-lightgrey
[d1]: https://img.shields.io/badge/Bazel-N%2FA-lightgrey
[i1a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_linux_cmake.yml?branch=main&label=CMake
[i1a1]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_linux_bazel.yml?branch=main&label=Bazel
[i1b0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/aarch64_linux_cmake.yml?branch=main&label=CMake
[i1c0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/arm_linux_cmake.yml?branch=main&label=CMake
[i1d0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/mips_linux_cmake.yml?branch=main&label=CMake
[i1e0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/power_linux_cmake.yml?branch=main&label=CMake
[i1f0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/riscv_linux_cmake.yml?branch=main&label=CMake
[i1g0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/s390x_linux_cmake.yml?branch=main&label=CMake
[i2a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_freebsd_cmake.yml?branch=main&label=CMake
[i3a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_macos_cmake.yml?branch=main&label=CMake
[i4a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_windows_cmake.yml?branch=main&label=CMake
[l1a0]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_cmake.yml
[l1a1]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_bazel.yml
[l1b0]: https://github.com/google/cpu_features/actions/workflows/aarch64_linux_cmake.yml
[l1c0]: https://github.com/google/cpu_features/actions/workflows/arm_linux_cmake.yml
[l1d0]: https://github.com/google/cpu_features/actions/workflows/mips_linux_cmake.yml
[l1e0]: https://github.com/google/cpu_features/actions/workflows/power_linux_cmake.yml
[l1f0]: https://github.com/google/cpu_features/actions/workflows/riscv_linux_cmake.yml
[l1g0]: https://github.com/google/cpu_features/actions/workflows/s390x_linux_cmake.yml
[l2a0]: https://github.com/google/cpu_features/actions/workflows/amd64_freebsd_cmake.yml
[l3a0]: https://github.com/google/cpu_features/actions/workflows/amd64_macos_cmake.yml
[l4a0]: https://github.com/google/cpu_features/actions/workflows/amd64_windows_cmake.yml
## Table of Contents
- [Design Rationale](#rationale)
- [Code samples](#codesample)
- [Running sample code](#usagesample)
- [What's supported](#support)
- [Android NDK's drop in replacement](#ndk)
- [License](#license)
- [Build with cmake](#cmake)
- [Community Bindings](#bindings)
<a name="rationale"></a>
## Design Rationale
- **Simple to use.** See the snippets below for examples.
- **Extensible.** Easy to add missing features or architectures.
- **Compatible with old compilers** and available on many architectures so it
can be used widely. To ensure that cpu_features works on as many platforms
as possible, we implemented it in a highly portable version of C: C99.
- **Sandbox-compatible.** The library uses a variety of strategies to cope
with sandboxed environments or when `cpuid` is unavailable. This is useful
when running integration tests in hermetic environments.
- **Thread safe, no memory allocation, and raises no exceptions.**
cpu_features is suitable for implementing fundamental libc functions like
`malloc`, `memcpy`, and `memcmp`.
- **Unit tested.**
<a name="codesample"></a>
## Code samples
**Note:** For C++ code, the library functions are defined in the `cpu_features` namespace.
### Checking features at runtime
Here's a simple example that executes a codepath if the CPU supports both the
AES and the SSE4.2 instruction sets:
```c
#include "cpuinfo_x86.h"
// For C++, add `using namespace cpu_features;`
static const X86Features features = GetX86Info().features;
void Compute(void) {
if (features.aes && features.sse4_2) {
// Run optimized code.
} else {
// Run standard code.
}
}
```
### Caching for faster evaluation of complex checks
If you wish, you can read all the features at once into a global variable, and
then query for the specific features you care about. Below, we store all the ARM
features and then check whether AES and NEON are supported.
```c
#include <stdbool.h>
#include "cpuinfo_arm.h"
// For C++, add `using namespace cpu_features;`
static const ArmFeatures features = GetArmInfo().features;
static const bool has_aes_and_neon = features.aes && features.neon;
// use has_aes_and_neon.
```
This is a good approach to take if you're checking for combinations of features
when using a compiler that is slow to extract individual bits from bit-packed
structures.
### Checking compile time flags
The following code determines whether the compiler was told to use the AVX
instruction set (e.g., `g++ -mavx`) and sets `has_avx` accordingly.
```c
#include <stdbool.h>
#include "cpuinfo_x86.h"
// For C++, add `using namespace cpu_features;`
static const X86Features features = GetX86Info().features;
static const bool has_avx = CPU_FEATURES_COMPILED_X86_AVX || features.avx;
// use has_avx.
```
`CPU_FEATURES_COMPILED_X86_AVX` is set to 1 if the compiler was instructed to
use AVX and 0 otherwise, combining compile time and runtime knowledge.
### Rejecting poor hardware implementations based on microarchitecture
On x86, the first incarnation of a feature in a microarchitecture might not be
the most efficient (e.g. AVX on Sandy Bridge). We provide a function to retrieve
the underlying microarchitecture so you can decide whether to use it.
Below, `has_fast_avx` is set to 1 if the CPU supports the AVX instruction
set&mdash;but only if it's not Sandy Bridge.
```c
#include <stdbool.h>
#include "cpuinfo_x86.h"
// For C++, add `using namespace cpu_features;`
static const X86Info info = GetX86Info();
static const X86Microarchitecture uarch = GetX86Microarchitecture(&info);
static const bool has_fast_avx = info.features.avx && uarch != INTEL_SNB;
// use has_fast_avx.
```
This feature is currently available only for x86 microarchitectures.
<a name="usagesample"></a>
### Running sample code
Building `cpu_features` (check [quickstart](#quickstart) below) brings a small executable to test the library.
```shell
% ./build/list_cpu_features
arch : x86
brand : Intel(R) Xeon(R) CPU E5-1650 0 @ 3.20GHz
family : 6 (0x06)
model : 45 (0x2D)
stepping : 7 (0x07)
uarch : INTEL_SNB
flags : aes,avx,cx16,smx,sse4_1,sse4_2,ssse3
```
```shell
% ./build/list_cpu_features --json
{"arch":"x86","brand":" Intel(R) Xeon(R) CPU E5-1650 0 @ 3.20GHz","family":6,"model":45,"stepping":7,"uarch":"INTEL_SNB","flags":["aes","avx","cx16","smx","sse4_1","sse4_2","ssse3"]}
```
<a name="support"></a>
## What's supported
| | x86³ | AArch64 | ARM | MIPS⁴ | POWER | RISCV | s390x |
|---------|:----:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|
| Linux | yes² | yes¹ | yes¹ | yes¹ | yes¹ | yes¹ | yes¹ |
| FreeBSD | yes² | not yet | not yet | not yet | not yet | N/A | not yet |
| MacOs | yes² | not yet | N/A | N/A | no | N/A | no |
| Windows | yes² | not yet | not yet | N/A | N/A | N/A | N/A |
| Android | yes² | yes¹ | yes¹ | yes¹ | N/A | N/A | N/A |
| iOS | N/A | not yet | not yet | N/A | N/A | N/A | N/A |
1. **Features revealed from Linux.** We gather data from several sources
depending on availability:
+ from glibc's
[getauxval](https://www.gnu.org/software/libc/manual/html_node/Auxiliary-Vector.html)
+ by parsing `/proc/self/auxv`
+ by parsing `/proc/cpuinfo`
2. **Features revealed from CPU.** features are retrieved by using the `cpuid`
instruction.
3. **Microarchitecture detection.** On x86 some features are not always
implemented efficiently in hardware (e.g. AVX on Sandybridge). Exposing the
microarchitecture allows the client to reject particular microarchitectures.
4. All flavors of Mips are supported, little and big endian as well as 32/64
bits.
<a name="ndk"></a>
## Android NDK's drop in replacement
[cpu_features](https://github.com/google/cpu_features) is now officially
supporting Android and offers a drop in replacement of for the NDK's [cpu-features.h](https://android.googlesource.com/platform/ndk/+/main/sources/android/cpufeatures/cpu-features.h)
, see [ndk_compat](ndk_compat) folder for details.
<a name="license"></a>
## License
The cpu_features library is licensed under the terms of the Apache license.
See [LICENSE](LICENSE) for more information.
<a name="cmake"></a>
## Build with CMake
Please check the [CMake build instructions](cmake/README.md).
<a name="quickstart"></a>
### Quickstart
- Run `list_cpu_features`
```sh
cmake -S. -Bbuild -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release -j
./build/list_cpu_features --json
```
_Note_: Use `--target ALL_BUILD` on the second line for `Visual Studio` and `XCode`.
- run tests
```sh
cmake -S. -Bbuild -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug -j
cmake --build build --config Debug --target test
```
_Note_: Use `--target RUN_TESTS` on the last line for `Visual Studio` and `--target RUN_TEST` for `XCode`.
- install `cpu_features`
```sh
cmake --build build --config Release --target install -v
```
_Note_: Use `--target INSTALL` for `Visual Studio`.
_Note_: When using `Makefile` or `XCode` generator, you can use
[`DESTDIR`](https://www.gnu.org/software/make/manual/html_node/DESTDIR.html)
to install on a local repository.<br>
e.g.
```sh
cmake --build build --config Release --target install -v -- DESTDIR=install
```
<a name="bindings"></a>
## Community bindings
Links provided here are not affiliated with Google but are kindly provided by the OSS Community.
- .Net
- https://github.com/toor1245/cpu_features.NET
- Python
- https://github.com/Narasimha1997/py_cpu
- Java
- https://github.com/aecsocket/cpu-features-java
_Send PR to showcase your wrapper here_

19
node_modules/cpu-features/deps/cpu_features/WORKSPACE generated vendored Normal file
View File

@ -0,0 +1,19 @@
workspace(name = "com_google_cpufeatures")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "com_google_googletest",
tag = "release-1.11.0",
remote = "https://github.com/google/googletest.git",
)
git_repository(
name = "bazel_skylib",
tag = "1.2.0",
remote = "https://github.com/bazelbuild/bazel-skylib.git",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()

View File

@ -0,0 +1,5 @@
## Usage
To build tests with bazel
```sh
bazel test -s --verbose_failures //...
```

View File

@ -0,0 +1,11 @@
"""Defines global variables that lists target cpus"""
PLATFORM_CPU_X86_64 = ("@platforms//cpu:x86_64")
PLATFORM_CPU_ARM = ("@platforms//cpu:arm")
PLATFORM_CPU_ARM64 = ("@platforms//cpu:arm64")
PLATFORM_CPU_MIPS = ("@platforms//cpu:mips64")
PLATFORM_CPU_PPC = ("@platforms//cpu:ppc")

View File

@ -0,0 +1,3 @@
# CpuFeatures CMake configuration file
include("${CMAKE_CURRENT_LIST_DIR}/CpuFeaturesTargets.cmake")

View File

@ -0,0 +1,3 @@
# CpuFeaturesNdkCompat CMake configuration file
include("${CMAKE_CURRENT_LIST_DIR}/CpuFeaturesNdkCompatTargets.cmake")

View File

@ -0,0 +1,30 @@
# CMake build instructions
## Recommended usage : Incorporating cpu_features into a CMake project
For API / ABI compatibility reasons, it is recommended to build and use
cpu_features in a subdirectory of your project or as an embedded dependency.
This is similar to the recommended usage of the googletest framework
( https://github.com/google/googletest/blob/main/googletest/README.md )
Build and use step-by-step
1- Download cpu_features and copy it in a sub-directory in your project.
or add cpu_features as a git-submodule in your project
2- You can then use the cmake command `add_subdirectory()` to include
cpu_features directly and use the `cpu_features` target in your project.
3- Add the `CpuFeature::cpu_features` target to the `target_link_libraries()` section of
your executable or of your library.
## Disabling tests
CMake default options for cpu_features is `Release` built type with tests
enabled. To disable testing set cmake `BUILD_TESTING` variable to `OFF`.
e.g.
```sh
cmake -S. -Bbuild -DBUILD_TESTING=OFF
```

View File

@ -0,0 +1,252 @@
PROJECT := cpu_features
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
SHA1 := $(shell git rev-parse --verify HEAD)
# General commands
.PHONY: help
BOLD=\e[1m
RESET=\e[0m
help:
@echo -e "${BOLD}SYNOPSIS${RESET}"
@echo -e "\tmake <target> [NOCACHE=1]"
@echo
@echo -e "${BOLD}DESCRIPTION${RESET}"
@echo -e "\ttest build inside docker container to have a reproductible build."
@echo
@echo -e "${BOLD}MAKE TARGETS${RESET}"
@echo -e "\t${BOLD}help${RESET}: display this help and exit."
@echo
@echo -e "\t${BOLD}amd64_<stage>${RESET}: build <stage> docker image using an Ubuntu:latest x86_64 base image."
@echo -e "\t${BOLD}save_amd64_<stage>${RESET}: Save the <stage> docker image."
@echo -e "\t${BOLD}sh_amd64_<stage>${RESET}: run a container using the <stage> docker image (debug purpose)."
@echo -e "\t${BOLD}clean_amd64_<stage>${RESET}: Remove cache and docker image."
@echo
@echo -e "\tWith ${BOLD}<stage>${RESET}:"
@echo -e "\t\t${BOLD}env${RESET}"
@echo -e "\t\t${BOLD}devel${RESET}"
@echo -e "\t\t${BOLD}build${RESET}"
@echo -e "\t\t${BOLD}test${RESET}"
@echo -e "\t\t${BOLD}install_env${RESET}"
@echo -e "\t\t${BOLD}install_devel${RESET}"
@echo -e "\t\t${BOLD}install_build${RESET}"
@echo -e "\t\t${BOLD}install_test${RESET}"
@echo -e "\te.g. 'make amd64_build'"
@echo
@echo -e "\t${BOLD}<target>_<toolchain_stage>${RESET}: build <stage> docker image for a specific toolchain target."
@echo -e "\t${BOLD}save_<target>_<toolchain_stage>${RESET}: Save the <stage> docker image for a specific platform."
@echo -e "\t${BOLD}sh_<target>_<toolchain_stage>${RESET}: run a container using the <stage> docker image specified (debug purpose)."
@echo -e "\t${BOLD}clean_<target>_<toolchain_stage>${RESET}: Remove cache and docker image."
@echo
@echo -e "\tWith ${BOLD}<target>${RESET}:"
@echo -e "\t\t${BOLD}arm-linux-gnueabihf${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}armv8l-linux-gnueabihf${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}arm-linux-gnueabi${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}armeb-linux-gnueabihf${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}armeb-linux-gnueabi${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}aarch64-linux-gnu${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}aarch64${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}aarch64_be-linux-gnu${RESET} (linaro toolchain)"
@echo -e "\t\t${BOLD}aarch64be${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}mips32${RESET} (codespace toolchain)"
@echo -e "\t\t${BOLD}mips64${RESET} (codespace toolchain)"
@echo -e "\t\t${BOLD}mips32el${RESET} (codespace toolchain)"
@echo -e "\t\t${BOLD}mips64el${RESET} (codespace toolchain)"
@echo -e "\t\t${BOLD}ppc${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}ppc64${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}ppc64le${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}riscv32${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}riscv64${RESET} (bootlin toolchain)"
@echo -e "\t\t${BOLD}s390x${RESET} (bootlin toolchain)"
@echo
@echo -e "\tWith ${BOLD}<toolchain_stage>${RESET}:"
@echo -e "\t\t${BOLD}env${RESET}"
@echo -e "\t\t${BOLD}devel${RESET}"
@echo -e "\t\t${BOLD}build${RESET}"
@echo -e "\t\t${BOLD}test${RESET}"
@echo -e "\te.g. 'make aarch64_test'"
@echo
@echo -e "\t${BOLD}<VM>${RESET}: build the vagrant <VM> virtual machine."
@echo -e "\t${BOLD}clean_<VM>${RESET}: Remove virtual machine for the specified vm."
@echo
@echo -e "\t${BOLD}<VM>${RESET}:"
@echo -e "\t\t${BOLD}freebsd${RESET} (FreeBSD)"
@echo
@echo -e "\t${BOLD}clean${RESET}: Remove cache and ALL docker images."
@echo
@echo -e "\t${BOLD}NOCACHE=1${RESET}: use 'docker build --no-cache' when building container (default use cache)."
@echo
@echo -e "branch: $(BRANCH)"
@echo -e "sha1: $(SHA1)"
# Need to add cmd_platform to PHONY otherwise target are ignored since they do not
# contain recipe (using FORCE do not work here)
.PHONY: all
all: build
# Delete all implicit rules to speed up makefile
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =
# Keep all intermediate files
# ToDo: try to remove it later
.SECONDARY:
# Docker image name prefix.
IMAGE := ${PROJECT}
ifdef NOCACHE
DOCKER_BUILD_CMD := docker build --no-cache
else
DOCKER_BUILD_CMD := docker build
endif
DOCKER_RUN_CMD := docker run --rm --init --net=host
# $* stem
# $< first prerequist
# $@ target name
############
## NATIVE ##
############
STAGES = env devel build test install_env install_devel install_build install_test
targets_amd64 = $(addprefix amd64_, $(STAGES))
.PHONY: $(targets_amd64)
$(targets_amd64): amd64_%: docker/amd64/Dockerfile
#@docker image rm -f ${IMAGE}:amd64_$* 2>/dev/null
${DOCKER_BUILD_CMD} \
--tag ${IMAGE}:amd64_$* \
--target=$* \
-f $< \
../..
#$(info Create targets: save_amd64 $(addprefix save_amd64_, $(STAGES)) (debug).)
save_targets_amd64 = $(addprefix save_amd64_, $(STAGES))
.PHONY: $(save_targets_amd64)
$(save_targets_amd64): save_amd64_%: cache/amd64/docker_%.tar
cache/amd64/docker_%.tar: amd64_%
@rm -f $@
mkdir -p cache/amd64
docker save ${IMAGE}:amd64_$* -o $@
#$(info Create targets: $(addprefix sh_amd64_, $(STAGES)) (debug).)
sh_targets_amd64 = $(addprefix sh_amd64_, $(STAGES))
.PHONY: $(sh_targets_amd64)
$(sh_targets_amd64): sh_amd64_%: amd64_%
${DOCKER_RUN_CMD} -it --name ${IMAGE}_amd64_$* ${IMAGE}:amd64_$*
#$(info Create targets: $(addprefix clean_amd64_, $(STAGES)).)
clean_targets_amd64 = $(addprefix clean_amd64_, $(STAGES))
.PHONY: clean_amd64 $(clean_targets_amd64)
clean_amd64: $(clean_targets_amd64)
$(clean_targets_amd64): clean_amd64_%:
docker image rm -f ${IMAGE}:amd64_$* 2>/dev/null
rm -f cache/amd64/docker_$*.tar
###############
## TOOLCHAIN ##
###############
TOOLCHAIN_TARGETS = \
aarch64 aarch64be \
arm-linux-gnueabihf armv8l-linux-gnueabihf arm-linux-gnueabi armeb-linux-gnueabihf armeb-linux-gnueabi \
aarch64-linux-gnu aarch64_be-linux-gnu \
mips32 mips32el mips64 mips64el \
ppc ppc64 ppc64le \
riscv32 riscv64 \
s390x
TOOLCHAIN_STAGES = env devel build test
define toolchain-stage-target =
#$$(info STAGE: $1)
#$$(info Create targets: toolchain_$1 $(addsuffix _$1, $(TOOLCHAIN_TARGETS)).)
targets_toolchain_$1 = $(addsuffix _$1, $(TOOLCHAIN_TARGETS))
.PHONY: toolchain_$1 $$(targets_toolchain_$1)
toolchain_$1: $$(targets_toolchain_$1)
$$(targets_toolchain_$1): %_$1: docker/toolchain/Dockerfile
#@docker image rm -f ${IMAGE}:$$*_$1 2>/dev/null
${DOCKER_BUILD_CMD} \
--tag ${IMAGE}:$$*_$1 \
--build-arg TARGET=$$* \
--target=$1 \
-f $$< \
../..
#$$(info Create targets: save_toolchain_$1 $(addprefix save_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).)
save_targets_toolchain_$1 = $(addprefix save_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS)))
.PHONY: save_toolchain_$1 $$(save_targets_toolchain_$1)
save_toolchain_$1: $$(save_targets_toolchain_$1)
$$(save_targets_toolchain_$1): save_%_$1: cache/%/docker_$1.tar
cache/%/docker_$1.tar: %_$1
@rm -f $$@
mkdir -p cache/$$*
docker save ${IMAGE}:$$*_$1 -o $$@
#$$(info Create targets: $(addprefix sh_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))) (debug).)
sh_targets_toolchain_$1 = $(addprefix sh_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS)))
.PHONY: $$(sh_targets_toolchain_$1)
$$(sh_targets_toolchain_$1): sh_%_$1: %_$1
${DOCKER_RUN_CMD} -it --name ${IMAGE}_$$*_$1 ${IMAGE}:$$*_$1
#$$(info Create targets: clean_toolchain_$1 $(addprefix clean_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS))).)
clean_targets_toolchain_$1 = $(addprefix clean_, $(addsuffix _$1, $(TOOLCHAIN_TARGETS)))
.PHONY: clean_toolchain_$1 $$(clean_targets_toolchain_$1)
clean_toolchain_$1: $$(clean_targets_toolchain_$1)
$$(clean_targets_toolchain_$1): clean_%_$1:
docker image rm -f ${IMAGE}:$$*_$1 2>/dev/null
rm -f cache/$$*/docker_$1.tar
endef
$(foreach stage,$(TOOLCHAIN_STAGES),$(eval $(call toolchain-stage-target,$(stage))))
## MERGE ##
.PHONY: clean_toolchain
clean_toolchain: $(addprefix clean_toolchain_, $(TOOLCHAIN_STAGES))
-rmdir $(addprefix cache/, $(TOOLCHAIN_TARGETS))
.PHONY: env devel build test
env: amd64_env toolchain_env
devel: amd64_devel toolchain_devel
build: amd64_build toolchain_build
test: amd64_test toolchain_test
.PHONY: install_env install_devel install_build install_test
install_env: amd64_install_env
install_devel: amd64_install_devel
install_build: amd64_install_build
install_test: amd64_install_test
#############
## VAGRANT ##
#############
VMS = freebsd
vms_targets = $(addsuffix _build, $(VMS))
.PHONY: $(vms_targets)
$(vms_targets): %_build: vagrant/%/Vagrantfile
@cd vagrant/$* && vagrant destroy -f
cd vagrant/$* && vagrant up
clean_vms_targets = $(addprefix clean_, $(VMS))
.PHONY: clean_vms $(clean_vms_targets)
clean_vms: $(clean_vms_targets)
$(clean_vms_targets): clean_%:
cd vagrant/$* && vagrant destroy -f
-rm -rf vagrant/$*/.vagrant
###########
## CLEAN ##
###########
.PHONY: clean
clean: clean_amd64 clean_toolchain clean_vms
docker container prune -f
docker image prune -f
-rmdir cache
.PHONY: distclean
distclean: clean
-docker container rm -f $$(docker container ls -aq)
-docker image rm -f $$(docker image ls -aq)
-vagrant box remove -f generic/freebsd12

View File

@ -0,0 +1,40 @@
## Makefile/Docker testing
To test the build on various distro, we are using docker containers and a Makefile for orchestration.
pros:
* You are independent of third party CI runner config
(e.g. [github action virtual-environnments](https://github.com/actions/virtual-environments)).
* You can run it locally on your linux system.
* Most CI provide runners with docker and Makefile installed.
cons:
* Only GNU/Linux distro supported.
### Usage
To get the help simply type:
```sh
make
```
note: you can also use from top directory
```sh
make --directory=cmake/ci
```
### Example
For example to test mips32 inside an container:
```sh
make mips32_test
```
### Docker layers
Dockerfile is splitted in several stages.
![docker](doc/docker.svg)
## Makefile/Vagrant testing
To test build for FreeBSD we are using Vagrant and VirtualBox box.
This is similar to the docker stuff but use `vagrant` as `docker` cli and
VirtuaBox to replace the docker engine daemon.

Some files were not shown because too many files have changed in this diff Show More