1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

build: remove support for gyp

Upstream GYP has been unmaintained for some time now. The only big
downstream user is Node.js and they already maintain GYP build files
for their other dependencies.

This commit removes vcbuild.bat because:

1. it's entirely built around GYP, and
2. duplicates a lot of functionality that cmake provides out of the box

This commit also removes appveyor.yml. It hasn't been used after we
stopped providing prebuilt binaries for Windows about two years ago.

As if that isn't enough, this commit also removes the Android build
scripts. They were wrappers around GYP. Use CMake.

PR-URL: https://github.com/libuv/libuv/pull/2682
Refs: https://github.com/libuv/libuv/pull/2681
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
Ben Noordhuis 2020-04-07 18:24:05 +02:00
parent d21f5aeab0
commit 53f3c687fc
16 changed files with 48 additions and 1452 deletions

5
.gitignore vendored
View File

@ -37,11 +37,6 @@ vgcore.*
Makefile
Makefile.in
# Generated by gyp for android
*.target.mk
/android-toolchain
/out/
/build/
/test/.libs/

View File

@ -142,7 +142,6 @@ Bug fixes and features should come with tests. Add your tests in the
If you add a new test file, it needs to be registered in three places:
- `CMakeLists.txt`: add the file's name to the `uv_test_sources` list.
- `Makefile.am`: add the file's name to the `test_run_tests_SOURCES` list.
- `uv.gyp`: add the file's name to the `sources` list in the `run-tests` target.
Look at other tests to see how they should be structured (license boilerplate,
the way entry points are declared, etc.).

View File

@ -123,17 +123,9 @@ EXTRA_DIST = test/fixtures/empty_file \
include \
docs \
img \
android-configure-arm \
android-configure-arm64 \
android-configure-x86 \
android-configure-x86_64 \
CONTRIBUTING.md \
LICENSE \
README.md \
vcbuild.bat \
common.gypi \
gyp_uv.py \
uv.gyp
README.md

216
README.md
View File

@ -152,47 +152,14 @@ $ gpg --verify libuv-1.7.0.tar.gz.sign
## Build Instructions
For GCC there are two build methods: via autotools or via [GYP][].
GYP is a meta-build system which can generate MSVS, Makefile, and XCode
backends. It is best used for integration into other projects.
For UNIX-like platforms, including macOS, there are two build methods:
autotools or [CMake][].
To build with autotools:
For Windows, [CMake][] is the only supported build method and has the
following prerequisites:
```bash
$ sh autogen.sh
$ ./configure
$ make
$ make check
$ make install
```
<details>
To build with [CMake](https://cmake.org/):
```bash
$ mkdir -p out/cmake ; cd out/cmake # create build directory
$ cmake ../.. -DBUILD_TESTING=ON # generate project with test
$ cmake --build . # build
$ ctest -C Debug --output-on-failure # run tests
# Or manually run tests:
$ ./out/cmake/uv_run_tests # shared library build
$ ./out/cmake/uv_run_tests_a # static library build
```
To build with GYP, first run:
```bash
$ git clone https://chromium.googlesource.com/external/gyp build/gyp
```
### Windows
Prerequisites:
* [Python 2.6 or 2.7][] as it is required
by [GYP][].
If python is not in your path, set the environment variable `PYTHON` to its
location. For example: `set PYTHON=C:\Python27\python.exe`
* One of:
* [Visual C++ Build Tools][]
* [Visual Studio 2015 Update 3][], all editions
@ -205,67 +172,35 @@ Prerequisites:
[Git for Windows][] includes Git Bash
and tools which can be included in the global `PATH`.
To build, launch a git shell (e.g. Cmd or PowerShell), run `vcbuild.bat`
(to build with VS2017 you need to explicitly add a `vs2017` argument),
which will checkout the GYP code into `build/gyp`, generate `uv.sln`
as well as the necesery related project files, and start building.
</details>
```console
> vcbuild
```
Or:
```console
> vcbuild vs2017
```
To run the tests:
```console
> vcbuild test
```
To see all the options that could passed to `vcbuild`:
```console
> vcbuild help
vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared]
Examples:
vcbuild.bat : builds debug build
vcbuild.bat test : builds debug build and runs tests
vcbuild.bat release bench: builds release build and runs benchmarks
```
### Unix
For Debug builds (recommended) run:
To build with autotools:
```bash
$ ./gyp_uv.py -f make
$ make -C out
$ sh autogen.sh
$ ./configure
$ make
$ make check
$ make install
```
For Release builds run:
To build with [CMake][]:
```bash
$ ./gyp_uv.py -f make
$ BUILDTYPE=Release make -C out
$ mkdir -p build
$ (cd build && cmake .. -DBUILD_TESTING=ON) # generate project with tests
$ cmake --build build # add `-j <n>` with cmake >= 3.12
# Run tests:
$ (cd build && ctest -C Debug --output-on-failure)
# Or manually run tests:
$ build/uv_run_tests # shared library build
$ build/uv_run_tests_a # static library build
```
Run `./gyp_uv.py -f make -Dtarget_arch=x32` to build [x32][] binaries.
### OS X
Run:
```bash
$ ./gyp_uv.py -f xcode
$ xcodebuild -ARCHS="x86_64" -project out/uv.xcodeproj -configuration Release -alltargets
```
Using Homebrew:
### Install with Homebrew
```bash
$ brew install --HEAD libuv
@ -277,110 +212,48 @@ Make sure that you specify the architecture you wish to build for in the
"ARCHS" flag. You can specify more than one by delimiting with a space
(e.g. "x86_64 i386").
### Android
Run:
For arm
```bash
$ source ./android-configure-arm NDK_PATH gyp [API_LEVEL]
$ make -C out
```
or for arm64
```bash
$ source ./android-configure-arm64 NDK_PATH gyp [API_LEVEL]
$ make -C out
```
or for x86
```bash
$ source ./android-configure-x86 NDK_PATH gyp [API_LEVEL]
$ make -C out
```
or for x86_64
```bash
$ source ./android-configure-x86_64 NDK_PATH gyp [API_LEVEL]
$ make -C out
```
The default API level is 24, but a different one can be selected as follows:
```bash
$ source ./android-configure-arm ~/android-ndk-r15b gyp 21
$ make -C out
```
Note for UNIX users: compile your project with `-D_LARGEFILE_SOURCE` and
`-D_FILE_OFFSET_BITS=64`. GYP builds take care of that automatically.
### Using Ninja
To use ninja for build on ninja supported platforms, run:
```bash
$ ./gyp_uv.py -f ninja
$ ninja -C out/Debug #for debug build OR
$ ninja -C out/Release
```
### Running tests
#### Build
Build (includes tests):
```bash
$ ./gyp_uv.py -f make
$ make -C out
```
#### Run all tests
```bash
$ ./out/Debug/run-tests
```
Some tests are timing sensitive. Relaxing test timeouts may be necessary
on slow or overloaded machines:
```bash
$ env UV_TEST_TIMEOUT_MULTIPLIER=2 ./out/Debug/run-tests # 10s instead of 5s
$ env UV_TEST_TIMEOUT_MULTIPLIER=2 build/uv_run_tests # 10s instead of 5s
```
#### Run one test
The list of all tests is in `test/test-list.h`.
This invocation will cause the `run-tests` driver to fork and execute `TEST_NAME` in a child process:
This invocation will cause the test driver to fork and execute `TEST_NAME` in
a child process:
```bash
$ ./out/Debug/run-tests TEST_NAME
$ build/uv_run_tests_a TEST_NAME
```
This invocation will cause the `run-tests` driver to execute the test within the `run-tests` process:
This invocation will cause the test driver to execute the test in
the same process:
```bash
$ ./out/Debug/run-tests TEST_NAME TEST_NAME
$ build/uv_run_tests_a TEST_NAME TEST_NAME
```
#### Debugging tools
When running the test from within the `run-tests` process (`run-tests TEST_NAME TEST_NAME`), tools like gdb and valgrind work normally.
When running the test from a child of the `run-tests` process (`run-tests TEST_NAME`), use these tools in a fork-aware manner.
When running the test from within the test driver process
(`build/uv_run_tests_a TEST_NAME TEST_NAME`), tools like gdb and valgrind
work normally.
When running the test from a child of the test driver process
(`build/uv_run_tests_a TEST_NAME`), use these tools in a fork-aware manner.
##### Fork-aware gdb
Use the [follow-fork-mode](https://sourceware.org/gdb/onlinedocs/gdb/Forks.html) setting:
```
$ gdb --args out/Debug/run-tests TEST_NAME
$ gdb --args build/uv_run_tests_a TEST_NAME
(gdb) set follow-fork-mode child
...
@ -391,13 +264,14 @@ $ gdb --args out/Debug/run-tests TEST_NAME
Use the `--trace-children=yes` parameter:
```bash
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log out/Debug/run-tests TEST_NAME
$ valgrind --trace-children=yes -v --tool=memcheck --leak-check=full --track-origins=yes --leak-resolution=high --show-reachable=yes --log-file=memcheck-%p.log build/uv_run_tests_a TEST_NAME
```
### Running benchmarks
See the section on running tests.
The benchmark driver is `out/Debug/run-benchmarks` and the benchmarks are listed in `test/benchmark-list.h`.
The benchmark driver is `./uv_run_benchmarks_a` and the benchmarks are
listed in `test/benchmark-list.h`.
## Supported Platforms
@ -413,8 +287,6 @@ that is detected by `autoconf`.
[IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/)
describes the package in more detail.
AIX support for filesystem events is not compiled when building with `gyp`.
### z/OS Notes
z/OS creates System V semaphores and message queues. These persist on the system
@ -426,12 +298,10 @@ Use the `ipcrm` command to manually clear up System V resources.
See the [guidelines for contributing][].
[CMake]: https://cmake.org/
[node.js]: http://nodejs.org/
[GYP]: http://code.google.com/p/gyp/
[guidelines for contributing]: https://github.com/libuv/libuv/blob/master/CONTRIBUTING.md
[libuv_banner]: https://raw.githubusercontent.com/libuv/libuv/master/img/banner.png
[x32]: https://en.wikipedia.org/wiki/X32_ABI
[Python 2.6 or 2.7]: https://www.python.org/downloads/
[Visual C++ Build Tools]: https://visualstudio.microsoft.com/visual-cpp-build-tools/
[Visual Studio 2015 Update 3]: https://www.visualstudio.com/vs/older-downloads/
[Visual Studio 2017]: https://www.visualstudio.com/downloads/

View File

@ -47,8 +47,9 @@ All functionality related to the new platform must be implemented in its own
file inside ``src/unix/`` unless it's already done in a common file, in which
case adding an `ifdef` is fine.
Two build systems are supported: autotools and GYP. Ideally both need to be
supported, but if GYP does not support the new platform it can be left out.
Two build systems are supported: autotools and cmake. Ideally both need to be
supported, but if one of the two does not support the new platform it can be
left out.
### Windows

View File

@ -1,23 +0,0 @@
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-arm
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-4.9 \
--arch=arm \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=arm-linux-androideabi-ar
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export LINK=arm-linux-androideabi-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=arm -DOS=android -f make-android
fi

View File

@ -1,23 +0,0 @@
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-arm64
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=aarch64-linux-android-4.9 \
--arch=arm64 \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=aarch64-linux-android-ar
export CC=aarch64-linux-android-gcc
export CXX=aarch64-linux-android-g++
export LINK=aarch64-linux-android-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=arm64 -DOS=android -f make-android
fi

View File

@ -1,23 +0,0 @@
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-x86
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=x86-4.9 \
--arch=x86 \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=i686-linux-android-ar
export CC=i686-linux-android-gcc
export CXX=i686-linux-android-g++
export LINK=i686-linux-android-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=x86 -DOS=android -f make-android
fi

View File

@ -1,25 +0,0 @@
#!/bin/bash
export TOOLCHAIN=$PWD/android-toolchain-x86_64
mkdir -p $TOOLCHAIN
API=${3:-24}
$1/build/tools/make-standalone-toolchain.sh \
--toolchain=x86_64-4.9 \
--arch=x86_64 \
--install-dir=$TOOLCHAIN \
--platform=android-$API \
--force
export PATH=$TOOLCHAIN/bin:$PATH
export AR=x86_64-linux-android-ar
export CC=x86_64-linux-android-gcc
export CXX=x86_64-linux-android-g++
export LINK=x86_64-linux-android-g++
export PLATFORM=android
export CFLAGS="-D__ANDROID_API__=$API -fPIC"
export CXXFLAGS="-D__ANDROID_API__=$API -fPIC"
export LDFLAGS="-fPIC"
if [[ $2 == 'gyp' ]]
then
./gyp_uv.py -Dtarget_arch=x86_64 -DOS=android -f make-android
fi

View File

@ -1,32 +0,0 @@
version: v1.18.0.build{build}
init:
- git config --global core.autocrlf true
install:
- cinst -y nsis
matrix:
fast_finish: true
allow_failures:
- platform: x86
configuration: Release
- platform: x64
configuration: Release
platform:
- x86
- x64
configuration:
- Release
build_script:
# Fixed tag version number if using a tag.
- cmd: if "%APPVEYOR_REPO_TAG%" == "true" set APPVEYOR_BUILD_VERSION=%APPVEYOR_REPO_TAG_NAME%
# vcbuild overwrites the platform variable.
- cmd: set ARCH=%platform%
- cmd: vcbuild.bat release %ARCH% shared
cache:
- C:\projects\libuv\build\gyp

View File

@ -1,213 +0,0 @@
{
'variables': {
'target_arch%': 'ia32', # set v8's target architecture
'host_arch%': 'ia32', # set v8's host architecture
'uv_library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds
'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way
},
'target_defaults': {
'default_configuration': 'Debug',
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'cflags': [ '-g' ],
'msvs_settings': {
'VCCLCompilerTool': {
'target_conditions': [
['uv_library=="static_library"', {
'RuntimeLibrary': 1, # /MTd static debug
}, {
'RuntimeLibrary': 3, # /MDd DLL debug
}],
],
'Optimization': 0, # /Od, no optimization
'MinimalRebuild': 'false',
'OmitFramePointers': 'false',
'BasicRuntimeChecks': 3, # /RTC1
},
'VCLinkerTool': {
'LinkIncremental': 2, # enable incremental linking
},
},
'xcode_settings': {
'GCC_OPTIMIZATION_LEVEL': '0',
},
'conditions': [
['OS != "zos"', {
'cflags': [ '-O0', '-fno-common', '-fwrapv' ]
}],
['OS == "android"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}]
]
},
'Release': {
'defines': [ 'NDEBUG' ],
'cflags': [
'-O3',
],
'msvs_settings': {
'VCCLCompilerTool': {
'target_conditions': [
['uv_library=="static_library"', {
'RuntimeLibrary': 0, # /MT static release
}, {
'RuntimeLibrary': 2, # /MD DLL release
}],
],
'Optimization': 3, # /Ox, full optimization
'FavorSizeOrSpeed': 1, # /Ot, favour speed over size
'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible
'WholeProgramOptimization': 'true', # /GL, whole program optimization, needed for LTCG
'OmitFramePointers': 'true',
'EnableFunctionLevelLinking': 'true',
'EnableIntrinsicFunctions': 'true',
},
'VCLibrarianTool': {
'AdditionalOptions': [
'/LTCG', # link time code generation
],
},
'VCLinkerTool': {
'LinkTimeCodeGeneration': 1, # link-time code generation
'OptimizeReferences': 2, # /OPT:REF
'EnableCOMDATFolding': 2, # /OPT:ICF
'LinkIncremental': 1, # disable incremental linking
},
},
'conditions': [
['OS != "zos"', {
'cflags': [
'-fdata-sections',
'-ffunction-sections',
'-fno-common',
'-fomit-frame-pointer',
],
}],
]
}
},
'msvs_settings': {
'VCCLCompilerTool': {
'StringPooling': 'true', # pool string literals
'DebugInformationFormat': 3, # Generate a PDB
'WarningLevel': 3,
'BufferSecurityCheck': 'true',
'ExceptionHandling': 1, # /EHsc
'SuppressStartupBanner': 'true',
'WarnAsError': 'false',
'AdditionalOptions': [
'/MP', # compile across multiple CPUs
],
},
'VCLibrarianTool': {
},
'VCLinkerTool': {
'GenerateDebugInformation': 'true',
'RandomizedBaseAddress': 2, # enable ASLR
'DataExecutionPrevention': 2, # enable DEP
'AllowIsolation': 'true',
'SuppressStartupBanner': 'true',
'target_conditions': [
['_type=="executable"', {
'SubSystem': 1, # console executable
}],
],
},
},
'conditions': [
['OS == "win"', {
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin
'defines': [
'WIN32',
# we don't really want VC++ warning us about
# how dangerous C functions are...
'_CRT_SECURE_NO_DEPRECATE',
# ... or that C implementations shouldn't use
# POSIX names
'_CRT_NONSTDC_NO_DEPRECATE',
],
'target_conditions': [
['target_arch=="x64"', {
'msvs_configuration_platform': 'x64'
}]
]
}],
['OS in "freebsd dragonflybsd linux openbsd solaris android aix"', {
'cflags': [ '-Wall' ],
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
'target_conditions': [
['_type=="static_library"', {
'standalone_static_library': 1, # disable thin archive which needs binutils >= 2.19
}],
],
'conditions': [
[ 'host_arch != target_arch and target_arch=="ia32"', {
'cflags': [ '-m32' ],
'ldflags': [ '-m32' ],
}],
[ 'target_arch=="x32"', {
'cflags': [ '-mx32' ],
'ldflags': [ '-mx32' ],
}],
[ 'OS=="linux"', {
'cflags': [ '-ansi' ],
}],
[ 'OS=="solaris"', {
'cflags': [ '-pthreads' ],
'ldflags': [ '-pthreads' ],
}],
[ 'OS not in "solaris android zos"', {
'cflags': [ '-pthread' ],
'ldflags': [ '-pthread' ],
}],
[ 'OS=="aix" and target_arch=="ppc64"', {
'cflags': [ '-maix64' ],
'ldflags': [ '-maix64' ],
}],
],
}],
['OS=="mac"', {
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'USE_HEADERMAP': 'NO',
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
},
'conditions': [
['target_arch=="ia32"', {
'xcode_settings': {'ARCHS': ['i386']},
}],
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
],
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
}],
],
}],
['OS=="solaris"', {
'cflags': [ '-fno-omit-frame-pointer' ],
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
],
},
}

View File

@ -1,73 +0,0 @@
#!/usr/bin/env python
import os
import platform
import sys
try:
import multiprocessing.synchronize
gyp_parallel_support = True
except ImportError:
gyp_parallel_support = False
CC = os.environ.get('CC', 'cc')
script_dir = os.path.dirname(__file__)
uv_root = os.path.normpath(script_dir)
output_dir = os.path.join(os.path.abspath(uv_root), 'out')
sys.path.insert(0, os.path.join(uv_root, 'build', 'gyp', 'pylib'))
try:
import gyp
except ImportError:
print('You need to install gyp in build/gyp first. See the README.')
sys.exit(42)
def host_arch():
machine = platform.machine()
if machine == 'i386': return 'ia32'
if machine == 'AMD64': return 'x64'
if machine == 'x86_64': return 'x64'
if machine.startswith('arm'): return 'arm'
if machine.startswith('mips'): return 'mips'
return machine # Return as-is and hope for the best.
def run_gyp(args):
rc = gyp.main(args)
if rc != 0:
print('Error running GYP')
sys.exit(rc)
if __name__ == '__main__':
args = sys.argv[1:]
args.extend('-I common.gypi test/test.gyp'.split(' '))
args.append('--depth=' + uv_root)
# There's a bug with windows which doesn't allow this feature.
if sys.platform != 'win32':
if '-f' not in args:
args.extend('-f make'.split())
if 'eclipse' not in args and 'ninja' not in args:
args.extend(['-Goutput_dir=' + output_dir])
args.extend(['--generator-output', output_dir])
if not any(a.startswith('-Dhost_arch=') for a in args):
args.append('-Dhost_arch=%s' % host_arch())
if not any(a.startswith('-Dtarget_arch=') for a in args):
args.append('-Dtarget_arch=%s' % host_arch())
if not any(a.startswith('-Duv_library=') for a in args):
args.append('-Duv_library=static_library')
# Some platforms (OpenBSD for example) don't have multiprocessing.synchronize
# so gyp must be run with --no-parallel
if not gyp_parallel_support:
args.append('--no-parallel')
gyp_args = list(args)
print(gyp_args)
run_gyp(gyp_args)

View File

@ -26,7 +26,7 @@
* Versions with the same major number are ABI stable. API is allowed to
* evolve between minor releases, but only in a backwards compatible way.
* Make sure you update the -soname directives in configure.ac
* and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but
* whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but
* not UV_VERSION_PATCH.)
*/

View File

@ -1,295 +0,0 @@
{
'targets': [
{
'target_name': 'run-tests',
'type': 'executable',
'dependencies': [ '../uv.gyp:libuv' ],
'sources': [
'blackhole-server.c',
'echo-server.c',
'run-tests.c',
'runner.c',
'runner.h',
'test-get-loadavg.c',
'task.h',
'test-active.c',
'test-async.c',
'test-async-null-cb.c',
'test-callback-stack.c',
'test-callback-order.c',
'test-close-fd.c',
'test-close-order.c',
'test-connect-unspecified.c',
'test-connection-fail.c',
'test-cwd-and-chdir.c',
'test-default-loop-close.c',
'test-delayed-accept.c',
'test-eintr-handling.c',
'test-error.c',
'test-embed.c',
'test-emfile.c',
'test-env-vars.c',
'test-fail-always.c',
'test-fork.c',
'test-fs.c',
'test-fs-readdir.c',
'test-fs-copyfile.c',
'test-fs-event.c',
'test-fs-fd-hash.c',
'test-fs-open-flags.c',
'test-fs-poll.c',
'test-getters-setters.c',
'test-get-currentexe.c',
'test-get-memory.c',
'test-get-passwd.c',
'test-getaddrinfo.c',
'test-gethostname.c',
'test-getnameinfo.c',
'test-getsockname.c',
'test-gettimeofday.c',
'test-handle-fileno.c',
'test-homedir.c',
'test-hrtime.c',
'test-idle.c',
'test-idna.c',
'test-ip4-addr.c',
'test-ip6-addr.c',
'test-ipc-heavy-traffic-deadlock-bug.c',
'test-ipc-send-recv.c',
'test-ipc.c',
'test-list.h',
'test-loop-handles.c',
'test-loop-alive.c',
'test-loop-close.c',
'test-loop-stop.c',
'test-loop-time.c',
'test-loop-configure.c',
'test-walk-handles.c',
'test-watcher-cross-stop.c',
'test-multiple-listen.c',
'test-osx-select.c',
'test-pass-always.c',
'test-ping-pong.c',
'test-pipe-bind-error.c',
'test-pipe-connect-error.c',
'test-pipe-connect-multiple.c',
'test-pipe-connect-prepare.c',
'test-pipe-getsockname.c',
'test-pipe-pending-instances.c',
'test-pipe-sendmsg.c',
'test-pipe-server-close.c',
'test-pipe-close-stdout-read-stdin.c',
'test-pipe-set-non-blocking.c',
'test-pipe-set-fchmod.c',
'test-platform-output.c',
'test-poll.c',
'test-poll-close.c',
'test-poll-close-doesnt-corrupt-stack.c',
'test-poll-closesocket.c',
'test-poll-oob.c',
'test-process-priority.c',
'test-process-title.c',
'test-process-title-threadsafe.c',
'test-queue-foreach-delete.c',
'test-random.c',
'test-ref.c',
'test-run-nowait.c',
'test-run-once.c',
'test-semaphore.c',
'test-shutdown-close.c',
'test-shutdown-eof.c',
'test-shutdown-twice.c',
'test-signal.c',
'test-signal-multiple-loops.c',
'test-signal-pending-on-close.c',
'test-socket-buffer-size.c',
'test-spawn.c',
'test-strscpy.c',
'test-stdio-over-pipes.c',
'test-tcp-alloc-cb-fail.c',
'test-tcp-bind-error.c',
'test-tcp-bind6-error.c',
'test-tcp-close.c',
'test-tcp-close-accept.c',
'test-tcp-close-reset.c',
'test-tcp-close-while-connecting.c',
'test-tcp-create-socket-early.c',
'test-tcp-connect-error-after-write.c',
'test-tcp-shutdown-after-write.c',
'test-tcp-flags.c',
'test-tcp-connect-error.c',
'test-tcp-connect-timeout.c',
'test-tcp-connect6-error.c',
'test-tcp-open.c',
'test-tcp-write-to-half-open-connection.c',
'test-tcp-write-after-connect.c',
'test-tcp-writealot.c',
'test-tcp-write-fail.c',
'test-tcp-try-write.c',
'test-tcp-try-write-error.c',
'test-tcp-unexpected-read.c',
'test-tcp-oob.c',
'test-tcp-read-stop.c',
'test-tcp-write-queue-order.c',
'test-threadpool.c',
'test-threadpool-cancel.c',
'test-thread-equal.c',
'test-tmpdir.c',
'test-mutexes.c',
'test-thread.c',
'test-barrier.c',
'test-condvar.c',
'test-timer-again.c',
'test-timer-from-check.c',
'test-timer.c',
'test-tty-duplicate-key.c',
'test-tty-escape-sequence-processing.c',
'test-tty.c',
'test-udp-alloc-cb-fail.c',
'test-udp-bind.c',
'test-udp-connect.c',
'test-udp-create-socket-early.c',
'test-udp-dgram-too-big.c',
'test-udp-ipv6.c',
'test-udp-open.c',
'test-udp-options.c',
'test-udp-send-and-recv.c',
'test-udp-send-hang-loop.c',
'test-udp-send-immediate.c',
'test-udp-send-unreachable.c',
'test-udp-multicast-join.c',
'test-udp-multicast-join6.c',
'test-dlerror.c',
'test-udp-multicast-ttl.c',
'test-udp-multicast-interface.c',
'test-udp-multicast-interface6.c',
'test-udp-try-send.c',
'test-uname.c',
],
'conditions': [
[ 'OS=="win"', {
'sources': [
'runner-win.c',
'runner-win.h',
'../src/win/snprintf.c',
],
'libraries': [ '-lws2_32' ]
}, { # POSIX
'sources': [
'runner-unix.c',
'runner-unix.h',
],
'conditions': [
[ 'OS != "zos"', {
'defines': [ '_GNU_SOURCE' ],
'cflags': [ '-Wno-long-long' ],
'xcode_settings': {
'WARNING_CFLAGS': [ '-Wno-long-long' ]
}
}],
]},
],
[ 'OS in "mac dragonflybsd freebsd linux netbsd openbsd".split()', {
'link_settings': {
'libraries': [ '-lutil' ],
},
}],
[ 'OS=="solaris"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
'defines': [
'__EXTENSIONS__',
'_XOPEN_SOURCE=500',
],
}],
[ 'OS=="aix"', { # make test-fs.c compile, needs _POSIX_C_SOURCE
'defines': [
'_ALL_SOURCE',
'_XOPEN_SOURCE=500',
],
}],
[ 'OS == "zos"', {
'cflags': [ '-qxplink' ],
'ldflags': [ '-qxplink' ],
}],
['uv_library=="shared_library"', {
'defines': [ 'USING_UV_SHARED=1' ],
'conditions': [
[ 'OS == "zos"', {
'cflags': [ '-Wc,DLL' ],
}],
],
}],
],
'msvs-settings': {
'VCLinkerTool': {
'SubSystem': 1, # /subsystem:console
},
},
},
{
'target_name': 'run-benchmarks',
'type': 'executable',
'dependencies': [ '../uv.gyp:libuv' ],
'sources': [
'benchmark-async.c',
'benchmark-async-pummel.c',
'benchmark-fs-stat.c',
'benchmark-getaddrinfo.c',
'benchmark-list.h',
'benchmark-loop-count.c',
'benchmark-million-async.c',
'benchmark-million-timers.c',
'benchmark-multi-accept.c',
'benchmark-ping-pongs.c',
'benchmark-ping-udp.c',
'benchmark-pound.c',
'benchmark-pump.c',
'benchmark-sizes.c',
'benchmark-spawn.c',
'benchmark-thread.c',
'benchmark-tcp-write-batch.c',
'benchmark-udp-pummel.c',
'dns-server.c',
'echo-server.c',
'blackhole-server.c',
'run-benchmarks.c',
'runner.c',
'runner.h',
'task.h',
],
'conditions': [
[ 'OS=="win"', {
'sources': [
'runner-win.c',
'runner-win.h',
'../src/win/snprintf.c',
],
'libraries': [ '-lws2_32' ]
}, { # POSIX
'defines': [ '_GNU_SOURCE' ],
'sources': [
'runner-unix.c',
'runner-unix.h',
]
}],
[ 'OS == "zos"', {
'cflags': [ '-qxplink' ],
'ldflags': [ '-qxplink' ],
}],
['uv_library=="shared_library"', {
'defines': [ 'USING_UV_SHARED=1' ],
'conditions': [
[ 'OS == "zos"', {
'cflags': [ '-Wc,DLL' ],
}],
],
}],
],
'msvs-settings': {
'VCLinkerTool': {
'SubSystem': 1, # /subsystem:console
},
},
},
],
}

370
uv.gyp
View File

@ -1,370 +0,0 @@
{
'variables': {
'conditions': [
['OS=="win"', {
'shared_unix_defines': [ ],
}, {
'shared_unix_defines': [
'_LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
],
}],
['OS in "mac ios"', {
'shared_mac_defines': [ '_DARWIN_USE_64_BIT_INODE=1' ],
}, {
'shared_mac_defines': [ ],
}],
['OS=="zos"', {
'shared_zos_defines': [
'_ISOC99_SOURCE',
'_UNIX03_THREADS',
'_UNIX03_SOURCE',
'_UNIX03_WITHDRAWN',
'_OPEN_SYS_IF_EXT',
'_OPEN_SYS_SOCK_EXT3',
'_OPEN_SYS_SOCK_IPV6',
'_OPEN_MSGQ_EXT',
'_XOPEN_SOURCE_EXTENDED',
'_ALL_SOURCE',
'_LARGE_TIME_API',
'_OPEN_SYS_FILE_EXT',
'_AE_BIMODAL',
'PATH_MAX=255'
],
}, {
'shared_zos_defines': [ ],
}],
],
},
'targets': [
{
'target_name': 'libuv',
'type': '<(uv_library)',
'include_dirs': [
'include',
'src/',
],
'defines': [
'<@(shared_mac_defines)',
'<@(shared_unix_defines)',
'<@(shared_zos_defines)',
],
'direct_dependent_settings': {
'defines': [
'<@(shared_mac_defines)',
'<@(shared_unix_defines)',
'<@(shared_zos_defines)',
],
'include_dirs': [ 'include' ],
'conditions': [
['OS == "linux"', {
'defines': [ '_POSIX_C_SOURCE=200112' ],
}],
],
},
'sources': [
'common.gypi',
'include/uv.h',
'include/uv/tree.h',
'include/uv/errno.h',
'include/uv/threadpool.h',
'include/uv/version.h',
'src/fs-poll.c',
'src/heap-inl.h',
'src/idna.c',
'src/idna.h',
'src/inet.c',
'src/queue.h',
'src/random.c',
'src/strscpy.c',
'src/strscpy.h',
'src/threadpool.c',
'src/timer.c',
'src/uv-data-getter-setters.c',
'src/uv-common.c',
'src/uv-common.h',
'src/version.c'
],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'WARNING_CFLAGS': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
'OTHER_CFLAGS': [ '-g', '--std=gnu89' ],
},
'conditions': [
[ 'OS=="win"', {
'defines': [
'_WIN32_WINNT=0x0600',
'_GNU_SOURCE',
],
'sources': [
'include/uv/win.h',
'src/win/async.c',
'src/win/atomicops-inl.h',
'src/win/core.c',
'src/win/detect-wakeup.c',
'src/win/dl.c',
'src/win/error.c',
'src/win/fs.c',
'src/win/fs-event.c',
'src/win/getaddrinfo.c',
'src/win/getnameinfo.c',
'src/win/handle.c',
'src/win/handle-inl.h',
'src/win/internal.h',
'src/win/loop-watcher.c',
'src/win/pipe.c',
'src/win/thread.c',
'src/win/poll.c',
'src/win/process.c',
'src/win/process-stdio.c',
'src/win/req-inl.h',
'src/win/signal.c',
'src/win/snprintf.c',
'src/win/stream.c',
'src/win/stream-inl.h',
'src/win/tcp.c',
'src/win/tty.c',
'src/win/udp.c',
'src/win/util.c',
'src/win/winapi.c',
'src/win/winapi.h',
'src/win/winsock.c',
'src/win/winsock.h',
],
'link_settings': {
'libraries': [
'-ladvapi32',
'-liphlpapi',
'-lpsapi',
'-lshell32',
'-luser32',
'-luserenv',
'-lws2_32'
],
},
}, { # Not Windows i.e. POSIX
'sources': [
'include/uv/unix.h',
'include/uv/linux.h',
'include/uv/sunos.h',
'include/uv/darwin.h',
'include/uv/bsd.h',
'include/uv/aix.h',
'src/unix/async.c',
'src/unix/atomic-ops.h',
'src/unix/core.c',
'src/unix/dl.c',
'src/unix/fs.c',
'src/unix/getaddrinfo.c',
'src/unix/getnameinfo.c',
'src/unix/internal.h',
'src/unix/loop.c',
'src/unix/loop-watcher.c',
'src/unix/pipe.c',
'src/unix/poll.c',
'src/unix/process.c',
'src/unix/random-devurandom.c',
'src/unix/signal.c',
'src/unix/spinlock.h',
'src/unix/stream.c',
'src/unix/tcp.c',
'src/unix/thread.c',
'src/unix/tty.c',
'src/unix/udp.c',
],
'link_settings': {
'libraries': [ '-lm' ],
'conditions': [
['OS=="solaris"', {
'ldflags': [ '-pthreads' ],
}],
[ 'OS=="zos" and uv_library=="shared_library"', {
'ldflags': [ '-Wl,DLL' ],
}],
['OS != "solaris" and OS != "android" and OS != "zos"', {
'ldflags': [ '-pthread' ],
}],
],
},
'conditions': [
['uv_library=="shared_library"', {
'conditions': [
['OS=="zos"', {
'cflags': [ '-qexportall' ],
}, {
'cflags': [ '-fPIC' ],
}],
],
}],
['uv_library=="shared_library" and OS!="mac" and OS!="zos"', {
# This will cause gyp to set soname
# Must correspond with UV_VERSION_MAJOR
# in include/uv/version.h
'product_extension': 'so.1',
}],
],
}],
[ 'OS in "linux mac ios android zos"', {
'sources': [ 'src/unix/proctitle.c' ],
}],
[ 'OS != "zos"', {
'cflags': [
'-fvisibility=hidden',
'-g',
'--std=gnu89',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wstrict-prototypes',
],
}],
[ 'OS in "mac ios"', {
'sources': [
'src/unix/darwin.c',
'src/unix/fsevents.c',
'src/unix/darwin-proctitle.c',
'src/unix/random-getentropy.c',
],
'defines': [
'_DARWIN_USE_64_BIT_INODE=1',
'_DARWIN_UNLIMITED_SELECT=1',
]
}],
[ 'OS=="linux"', {
'defines': [ '_GNU_SOURCE' ],
'sources': [
'src/unix/linux-core.c',
'src/unix/linux-inotify.c',
'src/unix/linux-syscalls.c',
'src/unix/linux-syscalls.h',
'src/unix/procfs-exepath.c',
'src/unix/random-getrandom.c',
'src/unix/random-sysctl-linux.c',
'src/unix/sysinfo-loadavg.c',
],
'link_settings': {
'libraries': [ '-ldl', '-lrt' ],
},
}],
[ 'OS=="android"', {
'sources': [
'src/unix/linux-core.c',
'src/unix/linux-inotify.c',
'src/unix/linux-syscalls.c',
'src/unix/linux-syscalls.h',
'src/unix/pthread-fixes.c',
'src/unix/android-ifaddrs.c',
'src/unix/procfs-exepath.c',
'src/unix/random-getrandom.c',
'src/unix/random-sysctl-linux.c',
'src/unix/sysinfo-loadavg.c',
'src/unix/random-getentropy.c',
],
'link_settings': {
'libraries': [ '-ldl' ],
},
}],
[ 'OS=="solaris"', {
'sources': [
'src/unix/no-proctitle.c',
'src/unix/sunos.c',
],
'defines': [
'__EXTENSIONS__',
'_XOPEN_SOURCE=500',
],
'link_settings': {
'libraries': [
'-lkstat',
'-lnsl',
'-lsendfile',
'-lsocket',
],
},
}],
[ 'OS=="aix"', {
'variables': {
'os_name': '<!(uname -s)',
},
'sources': [
'src/unix/aix-common.c',
],
'defines': [
'_ALL_SOURCE',
'_XOPEN_SOURCE=500',
'_LINUX_SOURCE_COMPAT',
'_THREAD_SAFE',
],
'conditions': [
[ '"<(os_name)"=="OS400"', {
'sources': [
'src/unix/ibmi.c',
'src/unix/posix-poll.c',
'src/unix/no-fsevents.c',
'src/unix/no-proctitle.c',
],
}, {
'sources': [
'src/unix/aix.c'
],
'defines': [
'HAVE_SYS_AHAFS_EVPRODS_H'
],
'link_settings': {
'libraries': [
'-lperfstat',
],
},
}],
]
}],
[ 'OS=="freebsd" or OS=="dragonflybsd"', {
'sources': [ 'src/unix/freebsd.c' ],
}],
[ 'OS=="freebsd"', {
'sources': [ 'src/unix/random-getrandom.c' ],
}],
[ 'OS=="openbsd"', {
'sources': [
'src/unix/openbsd.c',
'src/unix/random-getentropy.c',
],
}],
[ 'OS=="netbsd"', {
'link_settings': {
'libraries': [ '-lkvm' ],
},
'sources': [ 'src/unix/netbsd.c' ],
}],
[ 'OS in "freebsd dragonflybsd openbsd netbsd".split()', {
'sources': [
'src/unix/posix-hrtime.c',
'src/unix/bsd-proctitle.c'
],
}],
[ 'OS in "ios mac freebsd dragonflybsd openbsd netbsd".split()', {
'sources': [
'src/unix/bsd-ifaddrs.c',
'src/unix/kqueue.c',
],
}],
['uv_library=="shared_library"', {
'defines': [ 'BUILDING_UV_SHARED=1' ]
}],
['OS=="zos"', {
'sources': [
'src/unix/pthread-fixes.c',
'src/unix/os390.c',
'src/unix/os390-syscalls.c'
]
}],
]
},
]
}

View File

@ -1,184 +0,0 @@
@echo off
cd %~dp0
if /i "%1"=="help" goto help
if /i "%1"=="--help" goto help
if /i "%1"=="-help" goto help
if /i "%1"=="/help" goto help
if /i "%1"=="?" goto help
if /i "%1"=="-?" goto help
if /i "%1"=="--?" goto help
if /i "%1"=="/?" goto help
@rem Process arguments.
set config=
set target=Build
set target_arch=ia32
set target_env=
set noprojgen=
set nobuild=
set run=
set vs_toolset=x86
set msbuild_platform=WIN32
set library=static_library
:next-arg
if "%1"=="" goto args-done
if /i "%1"=="debug" set config=Debug&goto arg-ok
if /i "%1"=="release" set config=Release&goto arg-ok
if /i "%1"=="test" set run=run-tests.exe&goto arg-ok
if /i "%1"=="bench" set run=run-benchmarks.exe&goto arg-ok
if /i "%1"=="clean" set target=Clean&goto arg-ok
if /i "%1"=="vs2017" set target_env=vs2017&goto arg-ok
if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
if /i "%1"=="x86" set target_arch=ia32&set msbuild_platform=WIN32&set vs_toolset=x86&goto arg-ok
if /i "%1"=="ia32" set target_arch=ia32&set msbuild_platform=WIN32&set vs_toolset=x86&goto arg-ok
if /i "%1"=="x64" set target_arch=x64&set msbuild_platform=x64&set vs_toolset=x64&goto arg-ok
if /i "%1"=="shared" set library=shared_library&goto arg-ok
if /i "%1"=="static" set library=static_library&goto arg-ok
:arg-ok
shift
goto next-arg
:args-done
if defined WindowsSDKDir goto select-target
if defined VCINSTALLDIR goto select-target
@rem Look for Visual Studio 2017 only if explicitly requested.
if "%target_env%" NEQ "vs2017" goto vs-set-2015
echo Looking for Visual Studio 2017
@rem Check if VS2017 is already setup, and for the requested arch.
if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%vs_toolset%_" goto found_vs2017
set "VSINSTALLDIR="
call tools\vswhere_usability_wrapper.cmd
if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015
@rem Need to clear VSINSTALLDIR for vcvarsall to work as expected.
@rem Keep current working directory after call to vcvarsall
set "VSCMD_START_DIR=%CD%"
set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vs_toolset%
echo calling: %vcvars_call%
call %vcvars_call%
:found_vs2017
echo Found MSVS version %VisualStudioVersion%
if %VSCMD_ARG_TGT_ARCH%==x64 set target_arch=x64&set msbuild_platform=x64&set vs_toolset=x64
set GYP_MSVS_VERSION=2017
goto select-target
@rem Look for Visual Studio 2015
:vs-set-2015
if not defined VS140COMNTOOLS goto vc-set-2013
if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013
call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2015
echo Using Visual Studio 2015
goto select-target
:vc-set-2013
@rem Look for Visual Studio 2013
if not defined VS120COMNTOOLS goto vc-set-2012
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2013
echo Using Visual Studio 2013
goto select-target
:vc-set-2012
@rem Look for Visual Studio 2012
if not defined VS110COMNTOOLS goto vc-set-2010
if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2010
call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2012
echo Using Visual Studio 2012
goto select-target
:vc-set-2010
@rem Look for Visual Studio 2010
if not defined VS100COMNTOOLS goto vc-set-2008
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2008
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2010
echo Using Visual Studio 2010
goto select-target
:vc-set-2008
@rem Look for Visual Studio 2008
if not defined VS90COMNTOOLS goto vc-set-notfound
if not exist "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-notfound
call "%VS90COMNTOOLS%\..\..\vc\vcvarsall.bat" %vs_toolset%
set GYP_MSVS_VERSION=2008
echo Using Visual Studio 2008
goto select-target
:vc-set-notfound
echo Warning: Visual Studio not found
:select-target
if not "%config%"=="" goto project-gen
if "%run%"=="run-tests.exe" set config=Debug& goto project-gen
if "%run%"=="run-benchmarks.exe" set config=Release& goto project-gen
set config=Debug
:project-gen
@rem Skip project generation if requested.
if defined noprojgen goto msbuild
@rem Generate the VS project.
if exist build\gyp goto have_gyp
echo git clone https://chromium.googlesource.com/external/gyp build/gyp
git clone https://chromium.googlesource.com/external/gyp build/gyp
if errorlevel 1 goto gyp_install_failed
goto have_gyp
:gyp_install_failed
echo Failed to download gyp. Make sure you have git installed, or
echo manually install gyp into %~dp0build\gyp.
exit /b 1
:have_gyp
if not defined PYTHON set PYTHON=python
"%PYTHON%" gyp_uv.py -Dtarget_arch=%target_arch% -Duv_library=%library%
if errorlevel 1 goto create-msvs-files-failed
if not exist uv.sln goto create-msvs-files-failed
echo Project files generated.
:msbuild
@rem Skip project generation if requested.
if defined nobuild goto run
@rem Check if VS build env is available
if defined VCINSTALLDIR goto msbuild-found
if defined WindowsSDKDir goto msbuild-found
echo Build skipped. To build, this file needs to run from VS cmd prompt.
goto run
@rem Build the sln with msbuild.
:msbuild-found
msbuild uv.sln /t:%target% /p:Configuration=%config% /p:Platform="%msbuild_platform%" /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 exit /b 1
msbuild test\test.sln /t:%target% /p:Configuration=%config% /p:Platform="%msbuild_platform%" /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 exit /b 1
:run
@rem Run tests if requested.
if "%run%"=="" goto exit
echo running 'test\%config%\%run%'
test\%config%\%run%
goto exit
:create-msvs-files-failed
echo Failed to create vc project files.
exit /b 1
:help
echo vcbuild.bat [debug/release] [test/bench] [clean] [noprojgen] [nobuild] [vs2017] [x86/x64] [static/shared]
echo Examples:
echo vcbuild.bat : builds debug build
echo vcbuild.bat test : builds debug build and runs tests
echo vcbuild.bat release bench: builds release build and runs benchmarks
goto exit
:exit