From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../python/gyp/test/win/asm-files/asm-files.gyp | 17 ++ third_party/python/gyp/test/win/asm-files/b.s | 0 third_party/python/gyp/test/win/asm-files/c.S | 0 third_party/python/gyp/test/win/asm-files/hello.cc | 7 + .../win/batch-file-action/batch-file-action.gyp | 21 +++ .../python/gyp/test/win/batch-file-action/infile | 1 + .../gyp/test/win/batch-file-action/somecmd.bat | 5 + third_party/python/gyp/test/win/command-quote/a.S | 0 .../gyp/test/win/command-quote/bat with spaces.bat | 7 + .../gyp/test/win/command-quote/command-quote.gyp | 79 ++++++++ .../python/gyp/test/win/command-quote/go.bat | 7 + .../command-quote/subdir/and/another/in-subdir.gyp | 27 +++ .../win/compiler-flags/additional-include-dirs.cc | 10 + .../win/compiler-flags/additional-include-dirs.gyp | 20 ++ .../test/win/compiler-flags/additional-options.cc | 10 + .../test/win/compiler-flags/additional-options.gyp | 31 +++ .../gyp/test/win/compiler-flags/analysis.gyp | 40 ++++ .../win/compiler-flags/buffer-security-check.gyp | 51 +++++ .../gyp/test/win/compiler-flags/buffer-security.cc | 12 ++ .../compiler-flags/calling-convention-cdecl.def | 6 + .../compiler-flags/calling-convention-fastcall.def | 6 + .../compiler-flags/calling-convention-stdcall.def | 6 + .../calling-convention-vectorcall.def | 6 + .../test/win/compiler-flags/calling-convention.cc | 6 + .../test/win/compiler-flags/calling-convention.gyp | 66 +++++++ .../test/win/compiler-flags/character-set-mbcs.cc | 11 ++ .../win/compiler-flags/character-set-unicode.cc | 15 ++ .../gyp/test/win/compiler-flags/character-set.gyp | 35 ++++ .../test/win/compiler-flags/compile-as-managed.cc | 9 + .../test/win/compiler-flags/compile-as-managed.gyp | 29 +++ .../test/win/compiler-flags/compile-as-winrt.cc | 12 ++ .../test/win/compiler-flags/compile-as-winrt.gyp | 20 ++ .../gyp/test/win/compiler-flags/debug-format.gyp | 48 +++++ .../win/compiler-flags/default-char-is-unsigned.cc | 15 ++ .../compiler-flags/default-char-is-unsigned.gyp | 20 ++ .../compiler-flags/disable-specific-warnings.cc | 9 + .../compiler-flags/disable-specific-warnings.gyp | 29 +++ .../enable-enhanced-instruction-set.cc | 28 +++ .../enable-enhanced-instruction-set.gyp | 68 +++++++ .../win/compiler-flags/exception-handling-on.cc | 24 +++ .../test/win/compiler-flags/exception-handling.gyp | 46 +++++ .../compiler-flags/floating-point-model-fast.cc | 19 ++ .../compiler-flags/floating-point-model-precise.cc | 19 ++ .../compiler-flags/floating-point-model-strict.cc | 19 ++ .../win/compiler-flags/floating-point-model.gyp | 43 +++++ .../force-include-files-with-precompiled.cc | 10 + .../test/win/compiler-flags/force-include-files.cc | 8 + .../win/compiler-flags/force-include-files.gyp | 36 ++++ .../win/compiler-flags/function-level-linking.cc | 11 ++ .../win/compiler-flags/function-level-linking.gyp | 28 +++ .../python/gyp/test/win/compiler-flags/hello.cc | 7 + .../gyp/test/win/compiler-flags/optimizations.gyp | 207 +++++++++++++++++++++ .../test/win/compiler-flags/pdbname-override.gyp | 26 +++ .../python/gyp/test/win/compiler-flags/pdbname.cc | 7 + .../python/gyp/test/win/compiler-flags/pdbname.gyp | 24 +++ .../python/gyp/test/win/compiler-flags/precomp.cc | 6 + .../python/gyp/test/win/compiler-flags/rtti-on.cc | 11 ++ .../python/gyp/test/win/compiler-flags/rtti.gyp | 37 ++++ .../gyp/test/win/compiler-flags/runtime-checks.cc | 11 ++ .../gyp/test/win/compiler-flags/runtime-checks.gyp | 29 +++ .../test/win/compiler-flags/runtime-library-md.cc | 19 ++ .../test/win/compiler-flags/runtime-library-mdd.cc | 19 ++ .../test/win/compiler-flags/runtime-library-mt.cc | 19 ++ .../test/win/compiler-flags/runtime-library-mtd.cc | 19 ++ .../test/win/compiler-flags/runtime-library.gyp | 48 +++++ .../test/win/compiler-flags/spectre-mitigation.gyp | 44 +++++ .../gyp/test/win/compiler-flags/subdir/header.h | 0 .../treat-wchar-t-as-built-in-type.gyp | 33 ++++ .../treat-wchar-t-as-built-in-type1.cc | 11 ++ .../treat-wchar-t-as-built-in-type2.cc | 11 ++ .../python/gyp/test/win/compiler-flags/uninit.cc | 13 ++ .../test/win/compiler-flags/warning-as-error.cc | 9 + .../test/win/compiler-flags/warning-as-error.gyp | 37 ++++ .../gyp/test/win/compiler-flags/warning-level.gyp | 115 ++++++++++++ .../gyp/test/win/compiler-flags/warning-level1.cc | 8 + .../gyp/test/win/compiler-flags/warning-level2.cc | 14 ++ .../gyp/test/win/compiler-flags/warning-level3.cc | 11 ++ .../gyp/test/win/compiler-flags/warning-level4.cc | 10 + .../python/gyp/test/win/enable-winrt/dllmain.cc | 30 +++ .../gyp/test/win/enable-winrt/enable-winrt.gyp | 39 ++++ .../gyptest-generator-output-different-drive.py | 44 +++++ .../win/generator-output-different-drive/prog.c | 10 + .../win/generator-output-different-drive/prog.gyp | 15 ++ .../python/gyp/test/win/gyptest-asm-files.py | 26 +++ .../test/win/gyptest-cl-additional-include-dirs.py | 22 +++ .../gyp/test/win/gyptest-cl-additional-options.py | 28 +++ .../python/gyp/test/win/gyptest-cl-analysis.py | 30 +++ .../test/win/gyptest-cl-buffer-security-check.py | 53 ++++++ .../gyp/test/win/gyptest-cl-calling-convention.py | 22 +++ .../gyp/test/win/gyptest-cl-character-set.py | 22 +++ .../gyp/test/win/gyptest-cl-compile-as-managed.py | 24 +++ .../gyp/test/win/gyptest-cl-compile-as-winrt.py | 20 ++ .../python/gyp/test/win/gyptest-cl-debug-format.py | 43 +++++ .../win/gyptest-cl-default-char-is-unsigned.py | 22 +++ .../win/gyptest-cl-disable-specific-warnings.py | 32 ++++ .../gyptest-cl-enable-enhanced-instruction-set.py | 49 +++++ .../gyp/test/win/gyptest-cl-exception-handling.py | 33 ++++ .../test/win/gyptest-cl-floating-point-model.py | 22 +++ .../gyp/test/win/gyptest-cl-force-include-files.py | 22 +++ .../test/win/gyptest-cl-function-level-linking.py | 54 ++++++ .../gyp/test/win/gyptest-cl-optimizations.py | 105 +++++++++++ .../gyp/test/win/gyptest-cl-pdbname-override.py | 27 +++ .../python/gyp/test/win/gyptest-cl-pdbname.py | 30 +++ third_party/python/gyp/test/win/gyptest-cl-rtti.py | 30 +++ .../gyp/test/win/gyptest-cl-runtime-checks.py | 30 +++ .../gyp/test/win/gyptest-cl-runtime-library.py | 22 +++ .../gyptest-cl-treat-wchar-t-as-built-in-type.py | 22 +++ .../gyp/test/win/gyptest-cl-warning-as-error.py | 30 +++ .../gyp/test/win/gyptest-cl-warning-level.py | 41 ++++ .../python/gyp/test/win/gyptest-command-quote.py | 42 +++++ .../python/gyp/test/win/gyptest-crosscompile-ar.py | 29 +++ .../python/gyp/test/win/gyptest-lib-ltcg.py | 22 +++ .../gyp/test/win/gyptest-link-additional-deps.py | 22 +++ .../test/win/gyptest-link-additional-options.py | 22 +++ .../python/gyp/test/win/gyptest-link-aslr.py | 35 ++++ .../gyp/test/win/gyptest-link-base-address.py | 62 ++++++ .../python/gyp/test/win/gyptest-link-debug-info.py | 26 +++ .../gyp/test/win/gyptest-link-default-libs.py | 22 +++ .../python/gyp/test/win/gyptest-link-deffile.py | 43 +++++ .../python/gyp/test/win/gyptest-link-defrelink.py | 56 ++++++ .../gyp/test/win/gyptest-link-delay-load-dlls.py | 35 ++++ .../gyp/test/win/gyptest-link-embed-manifest.py | 100 ++++++++++ .../python/gyp/test/win/gyptest-link-enable-uac.py | 104 +++++++++++ .../win/gyptest-link-enable-winrt-app-revision.py | 43 +++++ ...st-link-enable-winrt-target-platform-version.py | 47 +++++ .../gyp/test/win/gyptest-link-enable-winrt.py | 37 ++++ .../gyp/test/win/gyptest-link-entrypointsymbol.py | 24 +++ .../python/gyp/test/win/gyptest-link-fixed-base.py | 40 ++++ .../win/gyptest-link-force-symbol-reference.py | 26 +++ .../gyp/test/win/gyptest-link-generate-manifest.py | 127 +++++++++++++ .../gyp/test/win/gyptest-link-incremental.py | 37 ++++ .../test/win/gyptest-link-large-address-aware.py | 35 ++++ .../python/gyp/test/win/gyptest-link-large-pdb.py | 76 ++++++++ .../gyp/test/win/gyptest-link-library-adjust.py | 21 +++ .../test/win/gyptest-link-library-directories.py | 35 ++++ .../python/gyp/test/win/gyptest-link-ltcg.py | 44 +++++ .../python/gyp/test/win/gyptest-link-mapfile.py | 44 +++++ .../gyp/test/win/gyptest-link-nodefaultlib.py | 24 +++ .../gyp/test/win/gyptest-link-noimportlib.py | 30 +++ .../python/gyp/test/win/gyptest-link-nxcompat.py | 37 ++++ .../python/gyp/test/win/gyptest-link-opt-icf.py | 41 ++++ .../python/gyp/test/win/gyptest-link-opt-ref.py | 40 ++++ .../python/gyp/test/win/gyptest-link-ordering.py | 103 ++++++++++ .../python/gyp/test/win/gyptest-link-outputfile.py | 28 +++ .../gyp/test/win/gyptest-link-pdb-no-output.py | 25 +++ .../python/gyp/test/win/gyptest-link-pdb-output.py | 33 ++++ .../python/gyp/test/win/gyptest-link-pdb.py | 35 ++++ .../python/gyp/test/win/gyptest-link-pgo.py | 75 ++++++++ .../python/gyp/test/win/gyptest-link-profile.py | 37 ++++ .../gyp/test/win/gyptest-link-restat-importlib.py | 47 +++++ .../python/gyp/test/win/gyptest-link-safeseh.py | 46 +++++ .../python/gyp/test/win/gyptest-link-shard.py | 30 +++ .../python/gyp/test/win/gyptest-link-stacksize.py | 62 ++++++ .../python/gyp/test/win/gyptest-link-subsystem.py | 38 ++++ .../gyp/test/win/gyptest-link-target-machine.py | 28 +++ .../python/gyp/test/win/gyptest-link-tsaware.py | 33 ++++ .../win/gyptest-link-uldi-depending-on-module.py | 24 +++ .../python/gyp/test/win/gyptest-link-uldi.py | 28 +++ .../test/win/gyptest-link-unsupported-manifest.py | 27 +++ .../gyp/test/win/gyptest-link-update-manifest.py | 104 +++++++++++ .../test/win/gyptest-link-warnings-as-errors.py | 24 +++ .../gyp/test/win/gyptest-long-command-line.py | 23 +++ .../gyp/test/win/gyptest-macro-projectname.py | 24 +++ .../python/gyp/test/win/gyptest-macro-targetext.py | 26 +++ .../gyp/test/win/gyptest-macro-targetfilename.py | 37 ++++ .../gyp/test/win/gyptest-macro-targetname.py | 29 +++ .../gyp/test/win/gyptest-macro-targetpath.py | 30 +++ .../gyp/test/win/gyptest-macro-vcinstalldir.py | 24 +++ .../gyp/test/win/gyptest-macros-containing-gyp.py | 21 +++ .../win/gyptest-macros-in-inputs-and-outputs.py | 27 +++ .../python/gyp/test/win/gyptest-midl-excluded.py | 22 +++ .../gyp/test/win/gyptest-midl-includedirs.py | 21 +++ .../python/gyp/test/win/gyptest-midl-rules.py | 28 +++ .../python/gyp/test/win/gyptest-ml-safeseh.py | 22 +++ .../gyp/test/win/gyptest-quoting-commands.py | 25 +++ .../python/gyp/test/win/gyptest-rc-build.py | 29 +++ third_party/python/gyp/test/win/gyptest-sys.py | 27 +++ .../python/gyp/test/win/gyptest-system-include.py | 21 +++ .../python/gyp/test/win/idl-excluded/bad.idl | 6 + .../python/gyp/test/win/idl-excluded/copy-file.py | 11 ++ .../gyp/test/win/idl-excluded/idl-excluded.gyp | 58 ++++++ .../python/gyp/test/win/idl-excluded/program.cc | 7 + .../python/gyp/test/win/idl-includedirs/hello.cc | 7 + .../test/win/idl-includedirs/idl-includedirs.gyp | 26 +++ .../gyp/test/win/idl-includedirs/subdir/bar.idl | 13 ++ .../gyp/test/win/idl-includedirs/subdir/foo.idl | 14 ++ .../python/gyp/test/win/idl-rules/Window.idl | 9 + .../python/gyp/test/win/idl-rules/basic-idl.gyp | 67 +++++++ .../gyp/test/win/idl-rules/history_indexer.idl | 17 ++ .../gyp/test/win/idl-rules/history_indexer_user.cc | 15 ++ .../python/gyp/test/win/idl-rules/idl_compiler.py | 17 ++ .../gyp/test/win/importlib/dll_no_exports.cc | 9 + .../python/gyp/test/win/importlib/has-exports.cc | 10 + third_party/python/gyp/test/win/importlib/hello.cc | 9 + .../python/gyp/test/win/importlib/importlib.gyp | 30 +++ .../python/gyp/test/win/importlib/noimplib.gyp | 16 ++ .../python/gyp/test/win/large-pdb/dllmain.cc | 9 + .../python/gyp/test/win/large-pdb/large-pdb.gyp | 98 ++++++++++ third_party/python/gyp/test/win/large-pdb/main.cc | 7 + .../python/gyp/test/win/lib-crosscompile/answer.cc | 9 + .../python/gyp/test/win/lib-crosscompile/answer.h | 5 + .../gyp/test/win/lib-crosscompile/use_host_ar.gyp | 17 ++ .../python/gyp/test/win/lib-flags/answer.cc | 9 + third_party/python/gyp/test/win/lib-flags/answer.h | 5 + third_party/python/gyp/test/win/lib-flags/ltcg.gyp | 21 +++ .../python/gyp/test/win/linker-flags/a/x.cc | 7 + .../python/gyp/test/win/linker-flags/a/z.cc | 7 + .../gyp/test/win/linker-flags/additional-deps.cc | 10 + .../gyp/test/win/linker-flags/additional-deps.gyp | 30 +++ .../test/win/linker-flags/additional-options.gyp | 29 +++ .../python/gyp/test/win/linker-flags/aslr.gyp | 35 ++++ .../python/gyp/test/win/linker-flags/b/y.cc | 7 + .../gyp/test/win/linker-flags/base-address.gyp | 38 ++++ .../gyp/test/win/linker-flags/debug-info.gyp | 28 +++ .../gyp/test/win/linker-flags/deffile-multiple.gyp | 17 ++ .../python/gyp/test/win/linker-flags/deffile.cc | 13 ++ .../python/gyp/test/win/linker-flags/deffile.def | 8 + .../python/gyp/test/win/linker-flags/deffile.gyp | 38 ++++ .../gyp/test/win/linker-flags/delay-load-dlls.gyp | 35 ++++ .../python/gyp/test/win/linker-flags/delay-load.cc | 10 + .../gyp/test/win/linker-flags/embed-manifest.gyp | 109 +++++++++++ .../gyp/test/win/linker-flags/enable-uac.gyp | 45 +++++ .../gyp/test/win/linker-flags/entrypointsymbol.cc | 13 ++ .../gyp/test/win/linker-flags/entrypointsymbol.gyp | 28 +++ .../gyp/test/win/linker-flags/extra.manifest | 11 ++ .../gyp/test/win/linker-flags/extra2.manifest | 11 ++ .../gyp/test/win/linker-flags/fixed-base.gyp | 52 ++++++ .../win/linker-flags/force-symbol-reference.gyp | 39 ++++ .../test/win/linker-flags/generate-manifest.gyp | 166 +++++++++++++++++ .../python/gyp/test/win/linker-flags/hello.cc | 7 + .../gyp/test/win/linker-flags/incremental.gyp | 65 +++++++ .../gyp/test/win/linker-flags/inline_test.cc | 12 ++ .../python/gyp/test/win/linker-flags/inline_test.h | 5 + .../gyp/test/win/linker-flags/inline_test_main.cc | 15 ++ .../test/win/linker-flags/large-address-aware.gyp | 28 +++ .../gyp/test/win/linker-flags/library-adjust.cc | 10 + .../gyp/test/win/linker-flags/library-adjust.gyp | 16 ++ .../win/linker-flags/library-directories-define.cc | 7 + .../linker-flags/library-directories-reference.cc | 10 + .../test/win/linker-flags/library-directories.gyp | 42 +++++ .../gyp/test/win/linker-flags/link-ordering.gyp | 95 ++++++++++ .../gyp/test/win/linker-flags/link-warning.cc | 10 + .../python/gyp/test/win/linker-flags/ltcg.gyp | 42 +++++ .../python/gyp/test/win/linker-flags/main-crt.c | 8 + .../test/win/linker-flags/manifest-in-comment.cc | 13 ++ .../python/gyp/test/win/linker-flags/mapfile.cc | 12 ++ .../python/gyp/test/win/linker-flags/mapfile.gyp | 45 +++++ .../gyp/test/win/linker-flags/no-default-libs.cc | 18 ++ .../gyp/test/win/linker-flags/no-default-libs.gyp | 13 ++ .../gyp/test/win/linker-flags/nodefaultlib.cc | 13 ++ .../gyp/test/win/linker-flags/nodefaultlib.gyp | 30 +++ .../python/gyp/test/win/linker-flags/nxcompat.gyp | 35 ++++ .../python/gyp/test/win/linker-flags/opt-icf.cc | 29 +++ .../python/gyp/test/win/linker-flags/opt-icf.gyp | 63 +++++++ .../python/gyp/test/win/linker-flags/opt-ref.cc | 11 ++ .../python/gyp/test/win/linker-flags/opt-ref.gyp | 56 ++++++ .../gyp/test/win/linker-flags/outputfile.gyp | 58 ++++++ .../gyp/test/win/linker-flags/pdb-output.gyp | 49 +++++ .../python/gyp/test/win/linker-flags/pgo.gyp | 143 ++++++++++++++ .../python/gyp/test/win/linker-flags/profile.gyp | 50 +++++ .../gyp/test/win/linker-flags/program-database.gyp | 40 ++++ .../python/gyp/test/win/linker-flags/safeseh.gyp | 79 ++++++++ .../gyp/test/win/linker-flags/safeseh_hello.cc | 11 ++ .../gyp/test/win/linker-flags/safeseh_zero.asm | 10 + .../gyp/test/win/linker-flags/safeseh_zero64.asm | 9 + .../python/gyp/test/win/linker-flags/stacksize.gyp | 44 +++++ .../gyp/test/win/linker-flags/subdir/library.gyp | 13 ++ .../gyp/test/win/linker-flags/subsystem-windows.cc | 9 + .../python/gyp/test/win/linker-flags/subsystem.gyp | 70 +++++++ .../gyp/test/win/linker-flags/target-machine.gyp | 48 +++++ .../python/gyp/test/win/linker-flags/tsaware.gyp | 28 +++ .../test/win/linker-flags/unsupported-manifest.gyp | 13 ++ .../python/gyp/test/win/linker-flags/update_pgd.py | 35 ++++ .../gyp/test/win/linker-flags/warn-as-error.gyp | 33 ++++ third_party/python/gyp/test/win/linker-flags/x.cc | 7 + third_party/python/gyp/test/win/linker-flags/y.cc | 7 + third_party/python/gyp/test/win/linker-flags/z.cc | 7 + .../gyp/test/win/long-command-line/function.cc | 7 + .../python/gyp/test/win/long-command-line/hello.cc | 7 + .../win/long-command-line/long-command-line.gyp | 54 ++++++ third_party/python/gyp/test/win/ml-safeseh/a.asm | 10 + .../python/gyp/test/win/ml-safeseh/hello.cc | 11 ++ .../python/gyp/test/win/ml-safeseh/ml-safeseh.gyp | 24 +++ .../python/gyp/test/win/precompiled/gyptest-all.py | 21 +++ .../python/gyp/test/win/precompiled/hello.c | 14 ++ .../python/gyp/test/win/precompiled/hello.gyp | 28 +++ .../python/gyp/test/win/precompiled/hello2.c | 13 ++ .../python/gyp/test/win/precompiled/precomp.c | 8 + .../python/gyp/test/win/rc-build/Resource.h | 26 +++ third_party/python/gyp/test/win/rc-build/hello.cpp | 30 +++ third_party/python/gyp/test/win/rc-build/hello.gyp | 92 +++++++++ third_party/python/gyp/test/win/rc-build/hello.h | 3 + third_party/python/gyp/test/win/rc-build/hello.ico | Bin 0 -> 23558 bytes third_party/python/gyp/test/win/rc-build/hello.rc | 86 +++++++++ third_party/python/gyp/test/win/rc-build/hello3.rc | 87 +++++++++ third_party/python/gyp/test/win/rc-build/small.ico | Bin 0 -> 23558 bytes .../python/gyp/test/win/rc-build/subdir/hello2.rc | 87 +++++++++ .../python/gyp/test/win/rc-build/subdir/include.h | 1 + .../python/gyp/test/win/rc-build/targetver.h | 24 +++ third_party/python/gyp/test/win/shard/hello.cc | 7 + third_party/python/gyp/test/win/shard/hello1.cc | 7 + third_party/python/gyp/test/win/shard/hello2.cc | 7 + third_party/python/gyp/test/win/shard/hello3.cc | 7 + third_party/python/gyp/test/win/shard/hello4.cc | 7 + third_party/python/gyp/test/win/shard/shard.gyp | 31 +++ .../python/gyp/test/win/shard/shard_ref.gyp | 41 ++++ .../gyp/test/win/system-include/bar/header.h | 0 .../test/win/system-include/common/commonheader.h | 0 .../gyp/test/win/system-include/foo/header.h | 0 .../python/gyp/test/win/system-include/main.cc | 4 + .../python/gyp/test/win/system-include/test.gyp | 26 +++ third_party/python/gyp/test/win/uldi/a.cc | 7 + third_party/python/gyp/test/win/uldi/b.cc | 7 + third_party/python/gyp/test/win/uldi/dll.cc | 6 + third_party/python/gyp/test/win/uldi/exe.cc | 7 + third_party/python/gyp/test/win/uldi/main.cc | 10 + .../gyp/test/win/uldi/uldi-depending-on-module.gyp | 42 +++++ third_party/python/gyp/test/win/uldi/uldi.gyp | 45 +++++ third_party/python/gyp/test/win/vs-macros/as.py | 20 ++ .../gyp/test/win/vs-macros/containing-gyp.gyp | 39 ++++ .../python/gyp/test/win/vs-macros/do_stuff.py | 8 + third_party/python/gyp/test/win/vs-macros/hello.cc | 7 + .../gyp/test/win/vs-macros/input-output-macros.gyp | 32 ++++ third_party/python/gyp/test/win/vs-macros/input.S | 0 .../python/gyp/test/win/vs-macros/projectname.gyp | 29 +++ .../python/gyp/test/win/vs-macros/stuff.blah | 1 + .../python/gyp/test/win/vs-macros/targetext.gyp | 59 ++++++ .../gyp/test/win/vs-macros/targetfilename.gyp | 59 ++++++ .../python/gyp/test/win/vs-macros/targetname.gyp | 52 ++++++ .../python/gyp/test/win/vs-macros/targetpath.gyp | 59 ++++++ .../python/gyp/test/win/vs-macros/test_exists.py | 10 + .../python/gyp/test/win/vs-macros/vcinstalldir.gyp | 41 ++++ .../win-driver-target-type.c | 10 + .../win-driver-target-type.gyp | 32 ++++ .../win-driver-target-type.h | 13 ++ .../win-driver-target-type.rc | 14 ++ .../test/win/win-tool/copies_readonly_files.gyp | 29 +++ .../gyptest-win-tool-handles-readonly-files.py | 55 ++++++ .../test/win/winrt-app-type-revision/dllmain.cc | 30 +++ .../winrt-app-type-revison.gyp | 43 +++++ .../win/winrt-target-platform-version/dllmain.cc | 30 +++ .../winrt-target-platform-version.gyp | 49 +++++ 342 files changed, 9942 insertions(+) create mode 100644 third_party/python/gyp/test/win/asm-files/asm-files.gyp create mode 100644 third_party/python/gyp/test/win/asm-files/b.s create mode 100644 third_party/python/gyp/test/win/asm-files/c.S create mode 100644 third_party/python/gyp/test/win/asm-files/hello.cc create mode 100644 third_party/python/gyp/test/win/batch-file-action/batch-file-action.gyp create mode 100644 third_party/python/gyp/test/win/batch-file-action/infile create mode 100644 third_party/python/gyp/test/win/batch-file-action/somecmd.bat create mode 100644 third_party/python/gyp/test/win/command-quote/a.S create mode 100644 third_party/python/gyp/test/win/command-quote/bat with spaces.bat create mode 100644 third_party/python/gyp/test/win/command-quote/command-quote.gyp create mode 100644 third_party/python/gyp/test/win/command-quote/go.bat create mode 100644 third_party/python/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/additional-options.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/additional-options.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/analysis.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/buffer-security-check.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/buffer-security.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/calling-convention-cdecl.def create mode 100644 third_party/python/gyp/test/win/compiler-flags/calling-convention-fastcall.def create mode 100644 third_party/python/gyp/test/win/compiler-flags/calling-convention-stdcall.def create mode 100644 third_party/python/gyp/test/win/compiler-flags/calling-convention-vectorcall.def create mode 100644 third_party/python/gyp/test/win/compiler-flags/calling-convention.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/calling-convention.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/character-set-mbcs.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/character-set-unicode.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/character-set.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/compile-as-managed.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/compile-as-managed.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/debug-format.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/exception-handling-on.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/exception-handling.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/floating-point-model-fast.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/floating-point-model-precise.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/floating-point-model-strict.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/floating-point-model.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/force-include-files.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/force-include-files.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/function-level-linking.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/function-level-linking.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/hello.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/optimizations.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/pdbname-override.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/pdbname.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/pdbname.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/precomp.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/rtti-on.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/rtti.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-checks.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-checks.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-library-md.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-library-mdd.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-library-mt.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-library-mtd.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/runtime-library.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/spectre-mitigation.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/subdir/header.h create mode 100644 third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/uninit.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-as-error.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-as-error.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-level.gyp create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-level1.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-level2.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-level3.cc create mode 100644 third_party/python/gyp/test/win/compiler-flags/warning-level4.cc create mode 100644 third_party/python/gyp/test/win/enable-winrt/dllmain.cc create mode 100644 third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp create mode 100644 third_party/python/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py create mode 100644 third_party/python/gyp/test/win/generator-output-different-drive/prog.c create mode 100644 third_party/python/gyp/test/win/generator-output-different-drive/prog.gyp create mode 100644 third_party/python/gyp/test/win/gyptest-asm-files.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-additional-include-dirs.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-additional-options.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-analysis.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-buffer-security-check.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-calling-convention.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-character-set.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-compile-as-managed.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-compile-as-winrt.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-debug-format.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-default-char-is-unsigned.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-disable-specific-warnings.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-exception-handling.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-floating-point-model.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-force-include-files.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-function-level-linking.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-optimizations.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-pdbname-override.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-pdbname.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-rtti.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-runtime-checks.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-runtime-library.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-warning-as-error.py create mode 100644 third_party/python/gyp/test/win/gyptest-cl-warning-level.py create mode 100644 third_party/python/gyp/test/win/gyptest-command-quote.py create mode 100644 third_party/python/gyp/test/win/gyptest-crosscompile-ar.py create mode 100644 third_party/python/gyp/test/win/gyptest-lib-ltcg.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-additional-deps.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-additional-options.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-aslr.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-base-address.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-debug-info.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-default-libs.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-deffile.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-defrelink.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-delay-load-dlls.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-embed-manifest.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-enable-uac.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-enable-winrt-app-revision.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-enable-winrt.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-entrypointsymbol.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-fixed-base.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-force-symbol-reference.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-generate-manifest.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-incremental.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-large-address-aware.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-large-pdb.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-library-adjust.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-library-directories.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-ltcg.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-mapfile.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-nodefaultlib.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-noimportlib.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-nxcompat.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-opt-icf.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-opt-ref.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-ordering.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-outputfile.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-pdb-no-output.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-pdb-output.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-pdb.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-pgo.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-profile.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-restat-importlib.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-safeseh.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-shard.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-stacksize.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-subsystem.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-target-machine.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-tsaware.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-uldi-depending-on-module.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-uldi.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-unsupported-manifest.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-update-manifest.py create mode 100644 third_party/python/gyp/test/win/gyptest-link-warnings-as-errors.py create mode 100644 third_party/python/gyp/test/win/gyptest-long-command-line.py create mode 100644 third_party/python/gyp/test/win/gyptest-macro-projectname.py create mode 100644 third_party/python/gyp/test/win/gyptest-macro-targetext.py create mode 100644 third_party/python/gyp/test/win/gyptest-macro-targetfilename.py create mode 100644 third_party/python/gyp/test/win/gyptest-macro-targetname.py create mode 100644 third_party/python/gyp/test/win/gyptest-macro-targetpath.py create mode 100644 third_party/python/gyp/test/win/gyptest-macro-vcinstalldir.py create mode 100644 third_party/python/gyp/test/win/gyptest-macros-containing-gyp.py create mode 100644 third_party/python/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py create mode 100644 third_party/python/gyp/test/win/gyptest-midl-excluded.py create mode 100644 third_party/python/gyp/test/win/gyptest-midl-includedirs.py create mode 100644 third_party/python/gyp/test/win/gyptest-midl-rules.py create mode 100644 third_party/python/gyp/test/win/gyptest-ml-safeseh.py create mode 100644 third_party/python/gyp/test/win/gyptest-quoting-commands.py create mode 100644 third_party/python/gyp/test/win/gyptest-rc-build.py create mode 100644 third_party/python/gyp/test/win/gyptest-sys.py create mode 100644 third_party/python/gyp/test/win/gyptest-system-include.py create mode 100644 third_party/python/gyp/test/win/idl-excluded/bad.idl create mode 100644 third_party/python/gyp/test/win/idl-excluded/copy-file.py create mode 100644 third_party/python/gyp/test/win/idl-excluded/idl-excluded.gyp create mode 100644 third_party/python/gyp/test/win/idl-excluded/program.cc create mode 100644 third_party/python/gyp/test/win/idl-includedirs/hello.cc create mode 100644 third_party/python/gyp/test/win/idl-includedirs/idl-includedirs.gyp create mode 100644 third_party/python/gyp/test/win/idl-includedirs/subdir/bar.idl create mode 100644 third_party/python/gyp/test/win/idl-includedirs/subdir/foo.idl create mode 100644 third_party/python/gyp/test/win/idl-rules/Window.idl create mode 100644 third_party/python/gyp/test/win/idl-rules/basic-idl.gyp create mode 100644 third_party/python/gyp/test/win/idl-rules/history_indexer.idl create mode 100644 third_party/python/gyp/test/win/idl-rules/history_indexer_user.cc create mode 100644 third_party/python/gyp/test/win/idl-rules/idl_compiler.py create mode 100644 third_party/python/gyp/test/win/importlib/dll_no_exports.cc create mode 100644 third_party/python/gyp/test/win/importlib/has-exports.cc create mode 100644 third_party/python/gyp/test/win/importlib/hello.cc create mode 100644 third_party/python/gyp/test/win/importlib/importlib.gyp create mode 100644 third_party/python/gyp/test/win/importlib/noimplib.gyp create mode 100644 third_party/python/gyp/test/win/large-pdb/dllmain.cc create mode 100644 third_party/python/gyp/test/win/large-pdb/large-pdb.gyp create mode 100644 third_party/python/gyp/test/win/large-pdb/main.cc create mode 100644 third_party/python/gyp/test/win/lib-crosscompile/answer.cc create mode 100644 third_party/python/gyp/test/win/lib-crosscompile/answer.h create mode 100644 third_party/python/gyp/test/win/lib-crosscompile/use_host_ar.gyp create mode 100644 third_party/python/gyp/test/win/lib-flags/answer.cc create mode 100644 third_party/python/gyp/test/win/lib-flags/answer.h create mode 100644 third_party/python/gyp/test/win/lib-flags/ltcg.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/a/x.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/a/z.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/additional-deps.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/additional-deps.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/additional-options.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/aslr.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/b/y.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/base-address.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/debug-info.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/deffile.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/deffile.def create mode 100644 third_party/python/gyp/test/win/linker-flags/deffile.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/delay-load.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/enable-uac.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/extra.manifest create mode 100644 third_party/python/gyp/test/win/linker-flags/extra2.manifest create mode 100644 third_party/python/gyp/test/win/linker-flags/fixed-base.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/hello.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/incremental.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/inline_test.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/inline_test.h create mode 100644 third_party/python/gyp/test/win/linker-flags/inline_test_main.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/library-adjust.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/library-adjust.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/library-directories-define.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/library-directories.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/link-ordering.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/link-warning.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/ltcg.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/main-crt.c create mode 100644 third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/mapfile.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/mapfile.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/no-default-libs.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/nxcompat.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/opt-icf.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/opt-icf.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/opt-ref.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/opt-ref.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/outputfile.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/pdb-output.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/pgo.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/profile.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/program-database.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/safeseh.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm create mode 100644 third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm create mode 100644 third_party/python/gyp/test/win/linker-flags/stacksize.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/subdir/library.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/subsystem.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/target-machine.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/tsaware.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/update_pgd.py create mode 100644 third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp create mode 100644 third_party/python/gyp/test/win/linker-flags/x.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/y.cc create mode 100644 third_party/python/gyp/test/win/linker-flags/z.cc create mode 100644 third_party/python/gyp/test/win/long-command-line/function.cc create mode 100644 third_party/python/gyp/test/win/long-command-line/hello.cc create mode 100644 third_party/python/gyp/test/win/long-command-line/long-command-line.gyp create mode 100644 third_party/python/gyp/test/win/ml-safeseh/a.asm create mode 100644 third_party/python/gyp/test/win/ml-safeseh/hello.cc create mode 100644 third_party/python/gyp/test/win/ml-safeseh/ml-safeseh.gyp create mode 100644 third_party/python/gyp/test/win/precompiled/gyptest-all.py create mode 100644 third_party/python/gyp/test/win/precompiled/hello.c create mode 100644 third_party/python/gyp/test/win/precompiled/hello.gyp create mode 100644 third_party/python/gyp/test/win/precompiled/hello2.c create mode 100644 third_party/python/gyp/test/win/precompiled/precomp.c create mode 100644 third_party/python/gyp/test/win/rc-build/Resource.h create mode 100644 third_party/python/gyp/test/win/rc-build/hello.cpp create mode 100644 third_party/python/gyp/test/win/rc-build/hello.gyp create mode 100644 third_party/python/gyp/test/win/rc-build/hello.h create mode 100644 third_party/python/gyp/test/win/rc-build/hello.ico create mode 100644 third_party/python/gyp/test/win/rc-build/hello.rc create mode 100644 third_party/python/gyp/test/win/rc-build/hello3.rc create mode 100644 third_party/python/gyp/test/win/rc-build/small.ico create mode 100644 third_party/python/gyp/test/win/rc-build/subdir/hello2.rc create mode 100644 third_party/python/gyp/test/win/rc-build/subdir/include.h create mode 100644 third_party/python/gyp/test/win/rc-build/targetver.h create mode 100644 third_party/python/gyp/test/win/shard/hello.cc create mode 100644 third_party/python/gyp/test/win/shard/hello1.cc create mode 100644 third_party/python/gyp/test/win/shard/hello2.cc create mode 100644 third_party/python/gyp/test/win/shard/hello3.cc create mode 100644 third_party/python/gyp/test/win/shard/hello4.cc create mode 100644 third_party/python/gyp/test/win/shard/shard.gyp create mode 100644 third_party/python/gyp/test/win/shard/shard_ref.gyp create mode 100644 third_party/python/gyp/test/win/system-include/bar/header.h create mode 100644 third_party/python/gyp/test/win/system-include/common/commonheader.h create mode 100644 third_party/python/gyp/test/win/system-include/foo/header.h create mode 100644 third_party/python/gyp/test/win/system-include/main.cc create mode 100644 third_party/python/gyp/test/win/system-include/test.gyp create mode 100644 third_party/python/gyp/test/win/uldi/a.cc create mode 100644 third_party/python/gyp/test/win/uldi/b.cc create mode 100644 third_party/python/gyp/test/win/uldi/dll.cc create mode 100644 third_party/python/gyp/test/win/uldi/exe.cc create mode 100644 third_party/python/gyp/test/win/uldi/main.cc create mode 100644 third_party/python/gyp/test/win/uldi/uldi-depending-on-module.gyp create mode 100644 third_party/python/gyp/test/win/uldi/uldi.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/as.py create mode 100644 third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/do_stuff.py create mode 100644 third_party/python/gyp/test/win/vs-macros/hello.cc create mode 100644 third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/input.S create mode 100644 third_party/python/gyp/test/win/vs-macros/projectname.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/stuff.blah create mode 100644 third_party/python/gyp/test/win/vs-macros/targetext.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/targetfilename.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/targetname.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/targetpath.gyp create mode 100644 third_party/python/gyp/test/win/vs-macros/test_exists.py create mode 100644 third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp create mode 100644 third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.c create mode 100644 third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp create mode 100644 third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.h create mode 100644 third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.rc create mode 100644 third_party/python/gyp/test/win/win-tool/copies_readonly_files.gyp create mode 100644 third_party/python/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py create mode 100644 third_party/python/gyp/test/win/winrt-app-type-revision/dllmain.cc create mode 100644 third_party/python/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp create mode 100644 third_party/python/gyp/test/win/winrt-target-platform-version/dllmain.cc create mode 100644 third_party/python/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp (limited to 'third_party/python/gyp/test/win') diff --git a/third_party/python/gyp/test/win/asm-files/asm-files.gyp b/third_party/python/gyp/test/win/asm-files/asm-files.gyp new file mode 100644 index 0000000000..b1f132ceea --- /dev/null +++ b/third_party/python/gyp/test/win/asm-files/asm-files.gyp @@ -0,0 +1,17 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'sources_with_asm', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'b.s', + 'c.S', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/asm-files/b.s b/third_party/python/gyp/test/win/asm-files/b.s new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/asm-files/c.S b/third_party/python/gyp/test/win/asm-files/c.S new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/asm-files/hello.cc b/third_party/python/gyp/test/win/asm-files/hello.cc new file mode 100644 index 0000000000..1711567ef5 --- /dev/null +++ b/third_party/python/gyp/test/win/asm-files/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/batch-file-action/batch-file-action.gyp b/third_party/python/gyp/test/win/batch-file-action/batch-file-action.gyp new file mode 100644 index 0000000000..e4db9af9d3 --- /dev/null +++ b/third_party/python/gyp/test/win/batch-file-action/batch-file-action.gyp @@ -0,0 +1,21 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_batch', + 'type': 'none', + 'actions': [ + { + 'action_name': 'copy_to_output', + 'inputs': ['infile'], + 'outputs': ['outfile'], + 'action': ['somecmd.bat', 'infile', 'outfile'], + 'msvs_cygwin_shell': 0, + } + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/batch-file-action/infile b/third_party/python/gyp/test/win/batch-file-action/infile new file mode 100644 index 0000000000..3f9177e45e --- /dev/null +++ b/third_party/python/gyp/test/win/batch-file-action/infile @@ -0,0 +1 @@ +input diff --git a/third_party/python/gyp/test/win/batch-file-action/somecmd.bat b/third_party/python/gyp/test/win/batch-file-action/somecmd.bat new file mode 100644 index 0000000000..d487753743 --- /dev/null +++ b/third_party/python/gyp/test/win/batch-file-action/somecmd.bat @@ -0,0 +1,5 @@ +@echo off +:: The redirs to nul are important. %2 can end up being an unterminated "'d +:: string, so the remainder of the command line becomes the target file name, +:: which in turn fails because it's a filename containing >, nul, etc. +copy /y %1 %2 >nul 2>nul diff --git a/third_party/python/gyp/test/win/command-quote/a.S b/third_party/python/gyp/test/win/command-quote/a.S new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/command-quote/bat with spaces.bat b/third_party/python/gyp/test/win/command-quote/bat with spaces.bat new file mode 100644 index 0000000000..dc3508f9a9 --- /dev/null +++ b/third_party/python/gyp/test/win/command-quote/bat with spaces.bat @@ -0,0 +1,7 @@ +@echo off + +:: 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. + +copy %1 %2 diff --git a/third_party/python/gyp/test/win/command-quote/command-quote.gyp b/third_party/python/gyp/test/win/command-quote/command-quote.gyp new file mode 100644 index 0000000000..faf724674f --- /dev/null +++ b/third_party/python/gyp/test/win/command-quote/command-quote.gyp @@ -0,0 +1,79 @@ +# 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. + +{ + 'target_defaults': { + 'msvs_cygwin_dirs': ['../../../../../<(DEPTH)/third_party/cygwin'], + }, + 'targets': [ + { + 'target_name': 'test_batch', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output.obj'], + 'action': ['call go.bat', '<(RULE_INPUT_PATH)', 'output.obj'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_call_separate', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch2', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output2.obj'], + 'action': ['call', 'go.bat', '<(RULE_INPUT_PATH)', 'output2.obj'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_with_spaces', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch3', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output3.obj'], + 'action': ['bat with spaces.bat', '<(RULE_INPUT_PATH)', 'output3.obj'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_with_double_quotes', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch3', + 'msvs_cygwin_shell': 1, + 'extension': 'S', + 'outputs': ['output4.obj'], + 'arguments': ['-v'], + 'action': ['python', '-c', 'import shutil; ' + 'shutil.copy("<(RULE_INPUT_PATH)", "output4.obj")'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_with_single_quotes', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch3', + 'msvs_cygwin_shell': 1, + 'extension': 'S', + 'outputs': ['output5.obj'], + 'action': ['python', '-c', "import shutil; " + "shutil.copy('<(RULE_INPUT_PATH)', 'output5.obj')"], + },], + 'sources': ['a.S'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/command-quote/go.bat b/third_party/python/gyp/test/win/command-quote/go.bat new file mode 100644 index 0000000000..dc3508f9a9 --- /dev/null +++ b/third_party/python/gyp/test/win/command-quote/go.bat @@ -0,0 +1,7 @@ +@echo off + +:: 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. + +copy %1 %2 diff --git a/third_party/python/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp b/third_party/python/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp new file mode 100644 index 0000000000..3dff4c40b9 --- /dev/null +++ b/third_party/python/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp @@ -0,0 +1,27 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_batch_depth', + 'type': 'none', + 'variables': { + # Taken from native_client/build/common.gypi. Seems unintentional (a + # string in a 1 element list)? But since it works on other generators, + # I guess it should work here too. + 'filepath': [ 'call <(DEPTH)/../../../go.bat' ], + }, + 'rules': [ + { + 'rule_name': 'build_with_batch4', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output4.obj'], + 'action': ['<@(filepath)', '<(RULE_INPUT_PATH)', 'output4.obj'], + },], + 'sources': ['<(DEPTH)\\..\\..\\..\\a.S'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.cc b/third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.cc new file mode 100644 index 0000000000..f1e11dd12d --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.cc @@ -0,0 +1,10 @@ +// 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. + +// No path qualification to test compiler include dir specification. +#include "header.h" + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.gyp b/third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.gyp new file mode 100644 index 0000000000..42c7e849f6 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/additional-include-dirs.gyp @@ -0,0 +1,20 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_incs', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': [ + 'subdir', + ], + } + }, + 'sources': ['additional-include-dirs.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/additional-options.cc b/third_party/python/gyp/test/win/compiler-flags/additional-options.cc new file mode 100644 index 0000000000..c79572bafa --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/additional-options.cc @@ -0,0 +1,10 @@ +// 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. + +int main() { + // Generate a warning that will appear at level 4, but not level 1 + // (truncation and unused local). + char c = 123456; + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/additional-options.gyp b/third_party/python/gyp/test/win/compiler-flags/additional-options.gyp new file mode 100644 index 0000000000..6a365a2062 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/additional-options.gyp @@ -0,0 +1,31 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_additional_none', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + } + }, + 'sources': ['additional-options.cc'], + }, + { + 'target_name': 'test_additional_one', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + 'AdditionalOptions': [ '/W1' ], + } + }, + 'sources': ['additional-options.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/analysis.gyp b/third_party/python/gyp/test/win/compiler-flags/analysis.gyp new file mode 100644 index 0000000000..97e942258f --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/analysis.gyp @@ -0,0 +1,40 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_analysis_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnablePREfast': 'true', + 'WarnAsError': 'true', + }, + }, + 'sources': ['uninit.cc'], + }, + { + 'target_name': 'test_analysis_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnablePREfast': 'false', + 'WarnAsError': 'true', + }, + }, + 'sources': ['uninit.cc'], + }, + { + 'target_name': 'test_analysis_unspec', + 'type': 'executable', + 'sources': ['uninit.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/buffer-security-check.gyp b/third_party/python/gyp/test/win/compiler-flags/buffer-security-check.gyp new file mode 100644 index 0000000000..cc5a12b953 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/buffer-security-check.gyp @@ -0,0 +1,51 @@ +# 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. + +{ + 'targets': [ + # Turn debug information on so that we can see the name of the buffer + # security check cookie in the disassembly. + { + 'target_name': 'test_bsc_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['buffer-security.cc'], + }, + { + 'target_name': 'test_bsc_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'BufferSecurityCheck': 'false', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['buffer-security.cc'], + }, + { + 'target_name': 'test_bsc_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'BufferSecurityCheck': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['buffer-security.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/buffer-security.cc b/third_party/python/gyp/test/win/compiler-flags/buffer-security.cc new file mode 100644 index 0000000000..e8a48a2a67 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/buffer-security.cc @@ -0,0 +1,12 @@ +// 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. + +#include +#include + +int main() { + char* stuff = reinterpret_cast(_alloca(256)); + strcpy(stuff, "blah"); + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/calling-convention-cdecl.def b/third_party/python/gyp/test/win/compiler-flags/calling-convention-cdecl.def new file mode 100644 index 0000000000..dc1dba055a --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/calling-convention-cdecl.def @@ -0,0 +1,6 @@ +; Copyright (c) 2014 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. + +EXPORTS + foo diff --git a/third_party/python/gyp/test/win/compiler-flags/calling-convention-fastcall.def b/third_party/python/gyp/test/win/compiler-flags/calling-convention-fastcall.def new file mode 100644 index 0000000000..2c61afe208 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/calling-convention-fastcall.def @@ -0,0 +1,6 @@ +; Copyright (c) 2014 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. + +EXPORTS + @foo@0 diff --git a/third_party/python/gyp/test/win/compiler-flags/calling-convention-stdcall.def b/third_party/python/gyp/test/win/compiler-flags/calling-convention-stdcall.def new file mode 100644 index 0000000000..6c7e05e9ea --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/calling-convention-stdcall.def @@ -0,0 +1,6 @@ +; Copyright (c) 2014 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. + +EXPORTS + _foo@0 diff --git a/third_party/python/gyp/test/win/compiler-flags/calling-convention-vectorcall.def b/third_party/python/gyp/test/win/compiler-flags/calling-convention-vectorcall.def new file mode 100644 index 0000000000..4ef119c3e3 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/calling-convention-vectorcall.def @@ -0,0 +1,6 @@ +; Copyright (c) 2014 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. + +EXPORTS + foo@@0 diff --git a/third_party/python/gyp/test/win/compiler-flags/calling-convention.cc b/third_party/python/gyp/test/win/compiler-flags/calling-convention.cc new file mode 100644 index 0000000000..0d78a0cc05 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/calling-convention.cc @@ -0,0 +1,6 @@ +// Copyright (c) 2014 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. + +extern "C" void foo() { +} diff --git a/third_party/python/gyp/test/win/compiler-flags/calling-convention.gyp b/third_party/python/gyp/test/win/compiler-flags/calling-convention.gyp new file mode 100644 index 0000000000..5069c552bc --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/calling-convention.gyp @@ -0,0 +1,66 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'test_cdecl', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 0, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-cdecl.def', + ], + }, + { + 'target_name': 'test_fastcall', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 1, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-fastcall.def', + ], + }, + { + 'target_name': 'test_stdcall', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 2, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-stdcall.def', + ], + }, + ], + 'conditions': [ + ['MSVS_VERSION[0:4]>="2013"', { + 'targets': [ + { + 'target_name': 'test_vectorcall', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 3, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-vectorcall.def', + ], + }, + ], + }], + ], +} diff --git a/third_party/python/gyp/test/win/compiler-flags/character-set-mbcs.cc b/third_party/python/gyp/test/win/compiler-flags/character-set-mbcs.cc new file mode 100644 index 0000000000..3286304730 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/character-set-mbcs.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef _MBCS +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/character-set-unicode.cc b/third_party/python/gyp/test/win/compiler-flags/character-set-unicode.cc new file mode 100644 index 0000000000..32e69724a5 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/character-set-unicode.cc @@ -0,0 +1,15 @@ +// 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. + +#ifndef _UNICODE +#error +#endif + +#ifndef UNICODE +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/character-set.gyp b/third_party/python/gyp/test/win/compiler-flags/character-set.gyp new file mode 100644 index 0000000000..3dc45557d9 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/character-set.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_cs_notset', + 'product_name': 'test_cs_notset', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'CharacterSet': '0' + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_cs_unicode', + 'product_name': 'test_cs_unicode', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'CharacterSet': '1' + }, + 'sources': ['character-set-unicode.cc'], + }, + { + 'target_name': 'test_cs_mbcs', + 'product_name': 'test_cs_mbcs', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'CharacterSet': '2' + }, + 'sources': ['character-set-mbcs.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/compile-as-managed.cc b/third_party/python/gyp/test/win/compiler-flags/compile-as-managed.cc new file mode 100644 index 0000000000..a29c71ee1d --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/compile-as-managed.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2015 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. + +#include + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/compile-as-managed.gyp b/third_party/python/gyp/test/win/compiler-flags/compile-as-managed.gyp new file mode 100644 index 0000000000..3bacbbc135 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/compile-as-managed.gyp @@ -0,0 +1,29 @@ +# Copyright (c) 2015 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. + +{ + 'targets': [ + { + 'target_name': 'test-compile-as-managed', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CompileAsManaged': 'true', + 'ExceptionHandling': '0' # /clr is incompatible with /EHs + } + }, + 'sources': ['compile-as-managed.cc'], + }, + { + 'target_name': 'test-compile-as-unmanaged', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CompileAsManaged': 'false', + } + }, + 'sources': ['compile-as-managed.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.cc b/third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.cc new file mode 100644 index 0000000000..da9954f8fb --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.cc @@ -0,0 +1,12 @@ +// Copyright (c) 2016 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. + +using namespace Platform; + +int main() { + wchar_t msg[] = L"Test"; + String^ str1 = ref new String(msg); + auto str2 = String::Concat(str1, " Concat"); + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.gyp b/third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.gyp new file mode 100644 index 0000000000..8978e5059d --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/compile-as-winrt.gyp @@ -0,0 +1,20 @@ +# Copyright (c) 2016 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. + +{ + 'targets': [ + { + 'target_name': 'test-compile-as-winrt', + 'type': 'executable', + 'msvs_windows_sdk_version': 'v10.0', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalUsingDirectories': ['$(VCInstallDir)vcpackages;$(WindowsSdkDir)UnionMetadata;%(AdditionalUsingDirectories)'], + 'CompileAsWinRT': 'true' + } + }, + 'sources': ['compile-as-winrt.cc'] + } + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/debug-format.gyp b/third_party/python/gyp/test/win/compiler-flags/debug-format.gyp new file mode 100644 index 0000000000..daaed23ff1 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/debug-format.gyp @@ -0,0 +1,48 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test-debug-format-off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test-debug-format-oldstyle', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test-debug-format-pdb', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test-debug-format-editcontinue', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '4' + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.cc b/third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.cc new file mode 100644 index 0000000000..beeca2aa15 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.cc @@ -0,0 +1,15 @@ +// 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. + +template +struct CompileAssert { +}; + +#define COMPILE_ASSERT(expr, msg) \ + typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +int main() { + COMPILE_ASSERT(char(-1) > 0, default_char_is_unsigned); + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp b/third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp new file mode 100644 index 0000000000..941e5810dd --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp @@ -0,0 +1,20 @@ +# Copyright (c) 2010 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. + +{ + 'targets': [ + { + 'target_name': 'test_default_char_is_unsigned', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DefaultCharIsUnsigned': 'true', + }, + }, + 'sources': [ + 'default-char-is-unsigned.cc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.cc b/third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.cc new file mode 100644 index 0000000000..d312f5f481 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2013 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. + +int main() { + // Causes level 1 warning (C4700) + int i; + return i; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.gyp b/third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.gyp new file mode 100644 index 0000000000..d81d694c62 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/disable-specific-warnings.gyp @@ -0,0 +1,29 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_disable_specific_warnings_set', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true', + 'DisableSpecificWarnings': ['4700'] + } + }, + 'sources': ['disable-specific-warnings.cc'] + }, + { + 'target_name': 'test_disable_specific_warnings_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true' + } + }, + 'sources': ['disable-specific-warnings.cc'] + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc b/third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc new file mode 100644 index 0000000000..432ef54eda --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2014 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. + +#include + +static const char* GetArchOption() { +#if _M_IX86_FP == 0 + return "IA32"; +#elif _M_IX86_FP == 1 + return "SSE"; +#elif _M_IX86_FP == 2 +# if defined(__AVX2__) + return "AVX2"; +# elif defined(__AVX__) + return "AVX"; +# else + return "SSE2"; +# endif +#else + return "UNSUPPORTED OPTION"; +#endif +} + +int main() { + printf("/arch:%s\n", GetArchOption()); + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp b/third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp new file mode 100644 index 0000000000..9c49edc7ff --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp @@ -0,0 +1,68 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'sse_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '1', # StreamingSIMDExtensions + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + { + 'target_name': 'sse2_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '2', # StreamingSIMDExtensions2 + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + ], + 'conditions': [ + ['MSVS_VERSION[0:4]>"2010"', { + 'targets': [ + { + 'target_name': 'avx_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '3', # AdvancedVectorExtensions + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + { + 'target_name': 'no_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '4', # NoExtensions + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + ], + }], + ['MSVS_VERSION[0:4]>="2013"', { + 'targets': [ + { + 'target_name': 'avx2_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '5', # AdvancedVectorExtensions2 + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + ], + }], + ], +} diff --git a/third_party/python/gyp/test/win/compiler-flags/exception-handling-on.cc b/third_party/python/gyp/test/win/compiler-flags/exception-handling-on.cc new file mode 100644 index 0000000000..5d9a3af77d --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/exception-handling-on.cc @@ -0,0 +1,24 @@ +// 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. + +#include +#include + +void fail() { + try { + int i = 0, j = 1; + j /= i; + } catch(...) { + exit(1); + } +} + +int main() { + __try { + fail(); + } __except(EXCEPTION_EXECUTE_HANDLER) { + return 2; + } + return 3; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/exception-handling.gyp b/third_party/python/gyp/test/win/compiler-flags/exception-handling.gyp new file mode 100644 index 0000000000..c266768dda --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/exception-handling.gyp @@ -0,0 +1,46 @@ +# 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. + +{ + 'targets': [ + # Optimization disabled so that the exception-causing code is not removed + # (divide by zero was getting optimized away in VS2010). + { + 'target_name': 'test_eh_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '0', + 'WarnAsError': 'true', + 'Optimization': '0', + } + }, + 'sources': ['exception-handling-on.cc'], + }, + { + 'target_name': 'test_eh_s', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '1', + 'WarnAsError': 'true', + 'Optimization': '0', + } + }, + 'sources': ['exception-handling-on.cc'], + }, + { + 'target_name': 'test_eh_a', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '2', + 'WarnAsError': 'true', + 'Optimization': '0', + } + }, + 'sources': ['exception-handling-on.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/floating-point-model-fast.cc b/third_party/python/gyp/test/win/compiler-flags/floating-point-model-fast.cc new file mode 100644 index 0000000000..9d22152f5e --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/floating-point-model-fast.cc @@ -0,0 +1,19 @@ +// Copyright (c) 2014 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. + +#ifdef _M_FP_PRECISE +#error +#endif + +#ifdef _M_FP_STRICT +#error +#endif + +#ifndef _M_FP_FAST +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/floating-point-model-precise.cc b/third_party/python/gyp/test/win/compiler-flags/floating-point-model-precise.cc new file mode 100644 index 0000000000..1191a74ed1 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/floating-point-model-precise.cc @@ -0,0 +1,19 @@ +// Copyright (c) 2014 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. + +#ifndef _M_FP_PRECISE +#error +#endif + +#ifdef _M_FP_STRICT +#error +#endif + +#ifdef _M_FP_FAST +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/floating-point-model-strict.cc b/third_party/python/gyp/test/win/compiler-flags/floating-point-model-strict.cc new file mode 100644 index 0000000000..1ffde36e0c --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/floating-point-model-strict.cc @@ -0,0 +1,19 @@ +// Copyright (c) 2014 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. + +#ifdef _M_FP_PRECISE +#error +#endif + +#ifndef _M_FP_STRICT +#error +#endif + +#ifdef _M_FP_FAST +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/floating-point-model.gyp b/third_party/python/gyp/test/win/compiler-flags/floating-point-model.gyp new file mode 100644 index 0000000000..857b275a8f --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/floating-point-model.gyp @@ -0,0 +1,43 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'test-floating-point-model-default', + 'type': 'executable', + 'sources': ['floating-point-model-precise.cc'], + }, + { + 'target_name': 'test-floating-point-model-precise', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FloatingPointModel': '0' + } + }, + 'sources': ['floating-point-model-precise.cc'], + }, + { + 'target_name': 'test-floating-point-model-strict', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FloatingPointModel': '1' + } + }, + 'sources': ['floating-point-model-strict.cc'], + }, + { + 'target_name': 'test-floating-point-model-fast', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FloatingPointModel': '2' + } + }, + 'sources': ['floating-point-model-fast.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc b/third_party/python/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc new file mode 100644 index 0000000000..85cb0f32a6 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc @@ -0,0 +1,10 @@ +// 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. + +#include + +int main() { + std::string s; + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/force-include-files.cc b/third_party/python/gyp/test/win/compiler-flags/force-include-files.cc new file mode 100644 index 0000000000..4a93de55d4 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/force-include-files.cc @@ -0,0 +1,8 @@ +// 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. + +int main() { + std::list > l; + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/force-include-files.gyp b/third_party/python/gyp/test/win/compiler-flags/force-include-files.gyp new file mode 100644 index 0000000000..2031546cc5 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/force-include-files.gyp @@ -0,0 +1,36 @@ +# Copyright (c) 2010 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. + +{ + 'targets': [ + { + 'target_name': 'test_force_include_files', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ForcedIncludeFiles': ['string', 'vector', 'list'], + }, + }, + 'sources': [ + 'force-include-files.cc', + ], + }, + { + 'target_name': 'test_force_include_with_precompiled', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ForcedIncludeFiles': ['string'], + }, + }, + 'msvs_precompiled_header': 'stdio.h', + 'msvs_precompiled_source': 'precomp.cc', + 'msvs_disabled_warnings': [ 4530, ], + 'sources': [ + 'force-include-files-with-precompiled.cc', + 'precomp.cc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/win/compiler-flags/function-level-linking.cc b/third_party/python/gyp/test/win/compiler-flags/function-level-linking.cc new file mode 100644 index 0000000000..4952272817 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/function-level-linking.cc @@ -0,0 +1,11 @@ +// 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. + +int comdat_function() { + return 1; +} + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/function-level-linking.gyp b/third_party/python/gyp/test/win/compiler-flags/function-level-linking.gyp new file mode 100644 index 0000000000..5858586a24 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/function-level-linking.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_fll_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'false' + } + }, + 'sources': ['function-level-linking.cc'], + }, + { + 'target_name': 'test_fll_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + } + }, + 'sources': ['function-level-linking.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/hello.cc b/third_party/python/gyp/test/win/compiler-flags/hello.cc new file mode 100644 index 0000000000..1711567ef5 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/optimizations.gyp b/third_party/python/gyp/test/win/compiler-flags/optimizations.gyp new file mode 100644 index 0000000000..e63096f0f7 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/optimizations.gyp @@ -0,0 +1,207 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_opt_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_lev_size', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_lev_speed', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_lev_max', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '3' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fpo', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'OmitFramePointers': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fpo_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'OmitFramePointers': 'false' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_intrinsic', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableIntrinsicFunctions': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_intrinsic_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableIntrinsicFunctions': 'false' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_inline_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'InlineFunctionExpansion': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_inline_manual', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'InlineFunctionExpansion': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_inline_auto', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'InlineFunctionExpansion': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_neither', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FavorSizeOrSpeed': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_speed', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FavorSizeOrSpeed': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_size', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FavorSizeOrSpeed': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_wpo', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_sp', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'StringPooling': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_sp_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'StringPooling': 'false' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fso', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFiberSafeOptimizations': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fso_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFiberSafeOptimizations': 'false' + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/pdbname-override.gyp b/third_party/python/gyp/test/win/compiler-flags/pdbname-override.gyp new file mode 100644 index 0000000000..dad20e01fd --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/pdbname-override.gyp @@ -0,0 +1,26 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_pdbname', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'pdbname.cc', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/compiler_generated.pdb', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/linker_generated.pdb', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/pdbname.cc b/third_party/python/gyp/test/win/compiler-flags/pdbname.cc new file mode 100644 index 0000000000..0fe05d5afb --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/pdbname.cc @@ -0,0 +1,7 @@ +// 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. + +int some_function() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/pdbname.gyp b/third_party/python/gyp/test/win/compiler-flags/pdbname.gyp new file mode 100644 index 0000000000..8fcf754727 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/pdbname.gyp @@ -0,0 +1,24 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_pdbname', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'pdbname.cc', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/precomp.cc b/third_party/python/gyp/test/win/compiler-flags/precomp.cc new file mode 100644 index 0000000000..d16bac890f --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/precomp.cc @@ -0,0 +1,6 @@ +// Copyright 2013 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. + +#include +#include diff --git a/third_party/python/gyp/test/win/compiler-flags/rtti-on.cc b/third_party/python/gyp/test/win/compiler-flags/rtti-on.cc new file mode 100644 index 0000000000..2d3ad03ae4 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/rtti-on.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef _CPPRTTI +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/rtti.gyp b/third_party/python/gyp/test/win/compiler-flags/rtti.gyp new file mode 100644 index 0000000000..704cd58f5a --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/rtti.gyp @@ -0,0 +1,37 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_rtti_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'false', + 'WarnAsError': 'true' + } + }, + 'sources': ['rtti-on.cc'], + }, + { + 'target_name': 'test_rtti_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'true', + 'WarnAsError': 'true' + } + }, + 'sources': ['rtti-on.cc'], + }, + { + 'target_name': 'test_rtti_unset', + 'type': 'executable', + 'msvs_settings': { + }, + 'sources': ['rtti-on.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-checks.cc b/third_party/python/gyp/test/win/compiler-flags/runtime-checks.cc new file mode 100644 index 0000000000..fdb811da87 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-checks.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef __MSVC_RUNTIME_CHECKS +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-checks.gyp b/third_party/python/gyp/test/win/compiler-flags/runtime-checks.gyp new file mode 100644 index 0000000000..8ea3092057 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-checks.gyp @@ -0,0 +1,29 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_brc_none', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0', + } + }, + 'sources': ['runtime-checks.cc'], + }, + { + 'target_name': 'test_brc_1', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0', + 'BasicRuntimeChecks': '3' + } + }, + 'sources': ['runtime-checks.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-library-md.cc b/third_party/python/gyp/test/win/compiler-flags/runtime-library-md.cc new file mode 100644 index 0000000000..87c83021d4 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-library-md.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifdef _DEBUG +#error +#endif + +#ifndef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-library-mdd.cc b/third_party/python/gyp/test/win/compiler-flags/runtime-library-mdd.cc new file mode 100644 index 0000000000..9f175e493e --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-library-mdd.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifndef _DEBUG +#error +#endif + +#ifndef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-library-mt.cc b/third_party/python/gyp/test/win/compiler-flags/runtime-library-mt.cc new file mode 100644 index 0000000000..27e62b63db --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-library-mt.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifdef _DEBUG +#error +#endif + +#ifdef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-library-mtd.cc b/third_party/python/gyp/test/win/compiler-flags/runtime-library-mtd.cc new file mode 100644 index 0000000000..a9921db9e2 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-library-mtd.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifndef _DEBUG +#error +#endif + +#ifdef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/runtime-library.gyp b/third_party/python/gyp/test/win/compiler-flags/runtime-library.gyp new file mode 100644 index 0000000000..04afc391c7 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/runtime-library.gyp @@ -0,0 +1,48 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_rl_md', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '2' + } + }, + 'sources': ['runtime-library-md.cc'], + }, + { + 'target_name': 'test_rl_mdd', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '3' + } + }, + 'sources': ['runtime-library-mdd.cc'], + }, + { + 'target_name': 'test_rl_mt', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '0' + } + }, + 'sources': ['runtime-library-mt.cc'], + }, + { + 'target_name': 'test_rl_mtd', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '1' + } + }, + 'sources': ['runtime-library-mtd.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/spectre-mitigation.gyp b/third_party/python/gyp/test/win/compiler-flags/spectre-mitigation.gyp new file mode 100644 index 0000000000..dad9cbd2c9 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/spectre-mitigation.gyp @@ -0,0 +1,44 @@ +# Copyright (c) 2023 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. + +{ + 'targets': [ + { + 'target_name': 'test_sm_notset', + 'product_name': 'test_sm_notset', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'SpectreMitigation': 'false' + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_sm_spectre', + 'product_name': 'test_sm_spectre', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'SpectreMitigation': 'Spectre' + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_sm_spectre_load', + 'product_name': 'test_sm_spectre_load', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'SpectreMitigation': 'SpectreLoad' + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_sm_spectre_load_cf', + 'product_name': 'test_sm_spectre_load_cf', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'SpectreMitigation': 'SpectreLoadCF' + }, + 'sources': ['hello.cc'], + } + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/subdir/header.h b/third_party/python/gyp/test/win/compiler-flags/subdir/header.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp b/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp new file mode 100644 index 0000000000..456fe047d0 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp @@ -0,0 +1,33 @@ +# Copyright (c) 2010 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. + +{ + 'targets': [ + { + 'target_name': 'test_treat_wchar_t_as_built_in_type_negative', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'TreatWChar_tAsBuiltInType': 'false', + }, + }, + 'sources': [ + 'treat-wchar-t-as-built-in-type1.cc', + ], + }, + { + 'target_name': 'test_treat_wchar_t_as_built_in_type_positive', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'TreatWChar_tAsBuiltInType': 'true', + }, + }, + 'sources': [ + 'treat-wchar-t-as-built-in-type2.cc', + ], + }, + + ], +} diff --git a/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc b/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc new file mode 100644 index 0000000000..fc1ed0b7ea --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc @@ -0,0 +1,11 @@ +// 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. + +#ifdef _NATIVE_WCHAR_T_DEFINED +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc b/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc new file mode 100644 index 0000000000..28ab94f742 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef _NATIVE_WCHAR_T_DEFINED +#error +#endif + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/uninit.cc b/third_party/python/gyp/test/win/compiler-flags/uninit.cc new file mode 100644 index 0000000000..a9d5f5d483 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/uninit.cc @@ -0,0 +1,13 @@ +// 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. + +// Should trigger C6001: using uninitialized memory for |i|. +int f(bool b) { + int i; + if (b) + i = 0; + return i; +} + +int main() {} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-as-error.cc b/third_party/python/gyp/test/win/compiler-flags/warning-as-error.cc new file mode 100644 index 0000000000..fd2130aca5 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-as-error.cc @@ -0,0 +1,9 @@ +// 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. + +int main() { + // Cause a warning, even at /W1 + int export; + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-as-error.gyp b/third_party/python/gyp/test/win/compiler-flags/warning-as-error.gyp new file mode 100644 index 0000000000..d71f261141 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-as-error.gyp @@ -0,0 +1,37 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_warn_as_error_false', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'false' + } + }, + 'sources': ['warning-as-error.cc'] + }, + { + 'target_name': 'test_warn_as_error_true', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true' + } + }, + 'sources': ['warning-as-error.cc'] + }, + { + 'target_name': 'test_warn_as_error_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + } + }, + 'sources': ['warning-as-error.cc'] + }, + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-level.gyp b/third_party/python/gyp/test/win/compiler-flags/warning-level.gyp new file mode 100644 index 0000000000..2297aa7cac --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-level.gyp @@ -0,0 +1,115 @@ +# 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. + +{ + 'targets': [ + # Level 1 + { + 'target_name': 'test_wl1_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '1', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level1.cc'], + }, + { + 'target_name': 'test_wl1_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '1', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level2.cc'], + }, + + # Level 2 + { + 'target_name': 'test_wl2_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '2', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level2.cc'], + }, + { + 'target_name': 'test_wl2_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '2', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level3.cc'], + }, + + # Level 3 + { + 'target_name': 'test_wl3_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '3', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level3.cc'], + }, + { + 'target_name': 'test_wl3_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '3', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level4.cc'], + }, + + + # Level 4 + { + 'target_name': 'test_wl4_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level4.cc'], + }, + + # Default level + { + 'target_name': 'test_def_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level1.cc'], + }, + { + 'target_name': 'test_def_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + } + }, + 'sources': ['warning-level2.cc'], + }, + + ] +} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-level1.cc b/third_party/python/gyp/test/win/compiler-flags/warning-level1.cc new file mode 100644 index 0000000000..119578d694 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-level1.cc @@ -0,0 +1,8 @@ +// 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. + +int main() { + int export; // Cause a level 1 warning (C4237). + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-level2.cc b/third_party/python/gyp/test/win/compiler-flags/warning-level2.cc new file mode 100644 index 0000000000..9a26703180 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-level2.cc @@ -0,0 +1,14 @@ +// 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. + +int f(int x) { + return 0; +} + +int main() { + double x = 10.1; + // Cause a level 2 warning (C4243). + return f(x); + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-level3.cc b/third_party/python/gyp/test/win/compiler-flags/warning-level3.cc new file mode 100644 index 0000000000..e0a9f3cdd9 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-level3.cc @@ -0,0 +1,11 @@ +// 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. + +// Cause a level 3 warning (C4359). +struct __declspec(align(8)) C8 { __int64 i; }; +struct __declspec(align(4)) C4 { C8 m8; }; + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/compiler-flags/warning-level4.cc b/third_party/python/gyp/test/win/compiler-flags/warning-level4.cc new file mode 100644 index 0000000000..48a4fb7018 --- /dev/null +++ b/third_party/python/gyp/test/win/compiler-flags/warning-level4.cc @@ -0,0 +1,10 @@ +// 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. + +int main() { + const int i = -1; + // Cause a level 4 warning (C4245). + unsigned int j = i; + return 0; +} diff --git a/third_party/python/gyp/test/win/enable-winrt/dllmain.cc b/third_party/python/gyp/test/win/enable-winrt/dllmain.cc new file mode 100644 index 0000000000..dedd83c3f6 --- /dev/null +++ b/third_party/python/gyp/test/win/enable-winrt/dllmain.cc @@ -0,0 +1,30 @@ +// Copyright (c) 2013 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. + +#include +#include +#include +#include + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr dp; + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); + if (SUCCEEDED(hr)) { + float dpi = 96.0f; + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) { + return true; + } + } + return false; +} + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp b/third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp new file mode 100644 index 0000000000..69f70189db --- /dev/null +++ b/third_party/python/gyp/test/win/enable-winrt/enable-winrt.gyp @@ -0,0 +1,39 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'enable_winrt_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_missing_dll', + 'type': 'shared_library', + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_winphone_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_enable_winphone': 1, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + '%(AdditionalDependencies)', + ], + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py b/third_party/python/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py new file mode 100644 index 0000000000..96a30ec5b9 --- /dev/null +++ b/third_party/python/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Test that the generator output can be written to a different drive on Windows. +""" + +import os +import TestGyp +import string +import subprocess +import sys + + +if sys.platform == 'win32': + import win32api + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + def GetFirstFreeDriveLetter(): + """ Returns the first unused Windows drive letter in [A, Z] """ + all_letters = [c for c in string.ascii_uppercase] + in_use = win32api.GetLogicalDriveStrings() + free = list(set(all_letters) - set(in_use)) + return free[0] + + output_dir = os.path.join('different-drive', 'output') + if not os.path.isdir(os.path.abspath(output_dir)): + os.makedirs(os.path.abspath(output_dir)) + output_drive = GetFirstFreeDriveLetter() + subprocess.call(['subst', '%c:' % output_drive, os.path.abspath(output_dir)]) + try: + test.run_gyp('prog.gyp', '--generator-output=%s' % ( + os.path.join(output_drive, 'output'))) + test.build('prog.gyp', test.ALL, chdir=os.path.join(output_drive, 'output')) + test.built_file_must_exist('program', chdir=os.path.join(output_drive, + 'output'), + type=test.EXECUTABLE) + test.pass_test() + finally: + subprocess.call(['subst', '%c:' % output_drive, '/D']) diff --git a/third_party/python/gyp/test/win/generator-output-different-drive/prog.c b/third_party/python/gyp/test/win/generator-output-different-drive/prog.c new file mode 100644 index 0000000000..7937f5d07a --- /dev/null +++ b/third_party/python/gyp/test/win/generator-output-different-drive/prog.c @@ -0,0 +1,10 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include + +int main(void) { + printf("Hello from prog.c\n"); + return 0; +} diff --git a/third_party/python/gyp/test/win/generator-output-different-drive/prog.gyp b/third_party/python/gyp/test/win/generator-output-different-drive/prog.gyp new file mode 100644 index 0000000000..92f53e5da5 --- /dev/null +++ b/third_party/python/gyp/test/win/generator-output-different-drive/prog.gyp @@ -0,0 +1,15 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'program', + 'type': 'executable', + 'sources': [ + 'prog.c', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/win/gyptest-asm-files.py b/third_party/python/gyp/test/win/gyptest-asm-files.py new file mode 100644 index 0000000000..007b52eb26 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-asm-files.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure .s files aren't passed to cl. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'asm-files' + test.run_gyp('asm-files.gyp', chdir=CHDIR) + # The compiler will error out if it's passed the .s files, so just make sure + # the build succeeds. The compiler doesn't directly support building + # assembler files on Windows, they have to be built explicitly with a + # third-party tool. + test.build('asm-files.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-additional-include-dirs.py b/third_party/python/gyp/test/win/gyptest-cl-additional-include-dirs.py new file mode 100644 index 0000000000..1fabfa9752 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-additional-include-dirs.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure additional include dirs are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('additional-include-dirs.gyp', chdir=CHDIR) + test.build('additional-include-dirs.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-additional-options.py b/third_party/python/gyp/test/win/gyptest-cl-additional-options.py new file mode 100644 index 0000000000..e9aea10dc9 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-additional-options.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure additional manual compiler flags are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('additional-options.gyp', chdir=CHDIR) + + # Warning level not overidden, must fail. + test.build('additional-options.gyp', 'test_additional_none', chdir=CHDIR, + status=1) + + # Warning level is overridden, must succeed. + test.build('additional-options.gyp', 'test_additional_one', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-analysis.py b/third_party/python/gyp/test/win/gyptest-cl-analysis.py new file mode 100644 index 0000000000..7b3b9897f5 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-analysis.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure PREfast (code analysis) setting is extracted properly. +""" + +import TestGyp + +import os +import sys + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2012): + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('analysis.gyp', chdir=CHDIR) + + # Analysis enabled, should fail. + test.build('analysis.gyp', 'test_analysis_on', chdir=CHDIR, status=1) + + # Analysis not enabled, or unspecified, should pass. + test.build('analysis.gyp', 'test_analysis_off', chdir=CHDIR) + test.build('analysis.gyp', 'test_analysis_unspec', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-buffer-security-check.py b/third_party/python/gyp/test/win/gyptest-cl-buffer-security-check.py new file mode 100644 index 0000000000..e22869c3d3 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-buffer-security-check.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure buffer security check setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('buffer-security-check.gyp', chdir=CHDIR) + test.build('buffer-security-check.gyp', chdir=CHDIR) + + def GetDisassemblyOfMain(exe): + # The standard library uses buffer security checks independent of our + # buffer security settings, so we extract just our code (i.e. main()) to + # check against. + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/disasm', full_path) + result = [] + in_main = False + for line in output.splitlines(): + if line == '_main:': + in_main = True + elif in_main: + # Disassembly of next function starts. + if line.startswith('_'): + break + result.append(line) + return '\n'.join(result) + + # Buffer security checks are on by default, make sure security_cookie + # appears in the disassembly of our code. + if 'security_cookie' not in GetDisassemblyOfMain('test_bsc_unset.exe'): + test.fail_test() + + # Explicitly on. + if 'security_cookie' not in GetDisassemblyOfMain('test_bsc_on.exe'): + test.fail_test() + + # Explicitly off, shouldn't be a reference to the security cookie. + if 'security_cookie' in GetDisassemblyOfMain('test_bsc_off.exe'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-calling-convention.py b/third_party/python/gyp/test/win/gyptest-cl-calling-convention.py new file mode 100644 index 0000000000..b5fdc47744 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-calling-convention.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 2014 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. + +""" +Make sure calling convention setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('calling-convention.gyp', chdir=CHDIR) + test.build('calling-convention.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-character-set.py b/third_party/python/gyp/test/win/gyptest-cl-character-set.py new file mode 100644 index 0000000000..7fabb6722a --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-character-set.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure character set setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('character-set.gyp', chdir=CHDIR) + test.build('character-set.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-compile-as-managed.py b/third_party/python/gyp/test/win/gyptest-cl-compile-as-managed.py new file mode 100644 index 0000000000..0d7b420485 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-compile-as-managed.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure compile as managed (clr) settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('compile-as-managed.gyp', chdir=CHDIR) + test.build('compile-as-managed.gyp', "test-compile-as-managed", chdir=CHDIR) + # Must fail. + test.build('compile-as-managed.gyp', "test-compile-as-unmanaged", + chdir=CHDIR, status=1) + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-compile-as-winrt.py b/third_party/python/gyp/test/win/gyptest-cl-compile-as-winrt.py new file mode 100644 index 0000000000..3e0168b678 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-compile-as-winrt.py @@ -0,0 +1,20 @@ +# Copyright (c) 2016 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. + +import TestGyp + +import os +import sys + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2015): + test = TestGyp.TestGyp(formats=['msvs']) + + CHDIR = 'compiler-flags' + + test.run_gyp('compile-as-winrt.gyp', chdir=CHDIR) + + test.build('compile-as-winrt.gyp', 'test-compile-as-winrt', chdir=CHDIR) + + test.pass_test() \ No newline at end of file diff --git a/third_party/python/gyp/test/win/gyptest-cl-debug-format.py b/third_party/python/gyp/test/win/gyptest-cl-debug-format.py new file mode 100644 index 0000000000..6c68a619be --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-debug-format.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure debug format settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('debug-format.gyp', chdir=CHDIR) + + # While there's ways to via .pdb contents, the .pdb doesn't include + # which style the debug information was created from, so we resort to just + # verifying the flags are correct on the command line. + + ninja_file = test.built_file_path('obj/test-debug-format-off.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/Z7') + test.must_not_contain(ninja_file, '/Zi') + test.must_not_contain(ninja_file, '/ZI') + + ninja_file = test.built_file_path('obj/test-debug-format-oldstyle.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Z7') + + ninja_file = test.built_file_path('obj/test-debug-format-pdb.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Zi') + + ninja_file = test.built_file_path('obj/test-debug-format-editcontinue.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/ZI') + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-default-char-is-unsigned.py b/third_party/python/gyp/test/win/gyptest-cl-default-char-is-unsigned.py new file mode 100644 index 0000000000..d20f6742f5 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-default-char-is-unsigned.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure DefaultCharIsUnsigned option is functional. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('default-char-is-unsigned.gyp', chdir=CHDIR) + test.build('default-char-is-unsigned.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-disable-specific-warnings.py b/third_party/python/gyp/test/win/gyptest-cl-disable-specific-warnings.py new file mode 100644 index 0000000000..cb253aff62 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-disable-specific-warnings.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure disable specific warnings is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('disable-specific-warnings.gyp', chdir=CHDIR) + + # The source file contains a warning, so if WarnAsError is true and + # DisableSpecificWarnings for the warning in question is set, then the build + # should succeed, otherwise it must fail. + + test.build('disable-specific-warnings.gyp', + 'test_disable_specific_warnings_set', + chdir=CHDIR) + test.build('disable-specific-warnings.gyp', + 'test_disable_specific_warnings_unset', + chdir=CHDIR, status=1) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py b/third_party/python/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py new file mode 100644 index 0000000000..f34e671125 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +# Copyright (c) 2014 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. + +""" +Test VCCLCompilerTool EnableEnhancedInstructionSet setting. +""" + +from __future__ import print_function + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + print("This test is currently disabled: https://crbug.com/483696.") + sys.exit(0) + + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('enable-enhanced-instruction-set.gyp', chdir=CHDIR) + + test.build('enable-enhanced-instruction-set.gyp', test.ALL, chdir=CHDIR) + + test.run_built_executable('sse_extensions', chdir=CHDIR, + stdout='/arch:SSE\n') + test.run_built_executable('sse2_extensions', chdir=CHDIR, + stdout='/arch:SSE2\n') + + # /arch:AVX introduced in VS2010, but MSBuild support lagged until 2012. + if os.path.exists(test.built_file_path('avx_extensions')): + test.run_built_executable('avx_extensions', chdir=CHDIR, + stdout='/arch:AVX\n') + + # /arch:IA32 introduced in VS2012. + if os.path.exists(test.built_file_path('no_extensions')): + test.run_built_executable('no_extensions', chdir=CHDIR, + stdout='/arch:IA32\n') + + # /arch:AVX2 introduced in VS2013r2. + if os.path.exists(test.built_file_path('avx2_extensions')): + test.run_built_executable('avx2_extensions', chdir=CHDIR, + stdout='/arch:AVX2\n') + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-exception-handling.py b/third_party/python/gyp/test/win/gyptest-cl-exception-handling.py new file mode 100644 index 0000000000..5738a54071 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-exception-handling.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure exception handling settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('exception-handling.gyp', chdir=CHDIR) + + # Must fail. + test.build('exception-handling.gyp', 'test_eh_off', chdir=CHDIR, + status=1) + + # Must succeed. + test.build('exception-handling.gyp', 'test_eh_s', chdir=CHDIR) + test.build('exception-handling.gyp', 'test_eh_a', chdir=CHDIR) + + # Error code must be 1 if EHa, and 2 if EHsc. + test.run_built_executable('test_eh_a', chdir=CHDIR, status=1) + test.run_built_executable('test_eh_s', chdir=CHDIR, status=2) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-floating-point-model.py b/third_party/python/gyp/test/win/gyptest-cl-floating-point-model.py new file mode 100644 index 0000000000..86ff4785a0 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-floating-point-model.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 2014 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. + +""" +Make sure floating point model settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('floating-point-model.gyp', chdir=CHDIR) + test.build('floating-point-model.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-force-include-files.py b/third_party/python/gyp/test/win/gyptest-cl-force-include-files.py new file mode 100644 index 0000000000..b73b8bd503 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-force-include-files.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure ForcedIncludeFiles option is functional. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('force-include-files.gyp', chdir=CHDIR) + test.build('force-include-files.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-function-level-linking.py b/third_party/python/gyp/test/win/gyptest-cl-function-level-linking.py new file mode 100644 index 0000000000..6ad7b8c484 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-function-level-linking.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure function-level linking setting is extracted properly. +""" + +from __future__ import print_function + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('function-level-linking.gyp', chdir=CHDIR) + test.build('function-level-linking.gyp', test.ALL, chdir=CHDIR) + + def CheckForSectionString(binary, search_for, should_exist): + output = test.run_dumpbin('/headers', binary) + if should_exist and search_for not in output: + print('Did not find "%s" in %s' % (search_for, binary)) + test.fail_test() + elif not should_exist and search_for in output: + print('Found "%s" in %s (and shouldn\'t have)' % (search_for, binary)) + test.fail_test() + + def Object(proj, obj): + sep = '.' if test.format == 'ninja' else '\\' + return 'obj\\%s%s%s' % (proj, sep, obj) + + look_for = '''COMDAT; sym= "int __cdecl comdat_function''' + + # When function level linking is on, the functions should be listed as + # separate comdat entries. + + CheckForSectionString( + test.built_file_path(Object('test_fll_on', 'function-level-linking.obj'), + chdir=CHDIR), + look_for, + should_exist=True) + + CheckForSectionString( + test.built_file_path(Object('test_fll_off', 'function-level-linking.obj'), + chdir=CHDIR), + look_for, + should_exist=False) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-optimizations.py b/third_party/python/gyp/test/win/gyptest-cl-optimizations.py new file mode 100644 index 0000000000..31341f7dd7 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-optimizations.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure optimization settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('optimizations.gyp', chdir=CHDIR) + + # It's hard to map flags to output contents in a non-fragile way (especially + # handling both 2008/2010), so just verify the correct ninja command line + # contents. + + ninja_file = test.built_file_path('obj/test_opt_off.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /Od') + + ninja_file = test.built_file_path('obj/test_opt_lev_size.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /O1') + + ninja_file = test.built_file_path('obj/test_opt_lev_speed.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /O2') + + ninja_file = test.built_file_path('obj/test_opt_lev_max.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /Ox') + + ninja_file = test.built_file_path('obj/test_opt_unset.ninja', chdir=CHDIR) + test.must_not_contain(ninja_file, '/Od') + test.must_not_contain(ninja_file, '/O1') + test.must_not_contain(ninja_file, '/Ox') + # Set by default if none specified. + test.must_contain(ninja_file, '/O2') + + ninja_file = test.built_file_path('obj/test_opt_fpo.ninja', chdir=CHDIR) + test.must_contain(ninja_file, '/Oy') + test.must_not_contain(ninja_file, '/Oy-') + + ninja_file = test.built_file_path('obj/test_opt_fpo_off.ninja', chdir=CHDIR) + test.must_contain(ninja_file, '/Oy-') + + ninja_file = test.built_file_path('obj/test_opt_intrinsic.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Oi') + test.must_not_contain(ninja_file, '/Oi-') + + ninja_file = test.built_file_path('obj/test_opt_intrinsic_off.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Oi-') + + ninja_file = test.built_file_path('obj/test_opt_inline_off.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ob0') + + ninja_file = test.built_file_path('obj/test_opt_inline_manual.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ob1') + + ninja_file = test.built_file_path('obj/test_opt_inline_auto.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ob2') + + ninja_file = test.built_file_path('obj/test_opt_neither.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/Os') + test.must_not_contain(ninja_file, '/Ot') + + ninja_file = test.built_file_path('obj/test_opt_size.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Os') + + ninja_file = test.built_file_path('obj/test_opt_speed.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ot') + + ninja_file = test.built_file_path('obj/test_opt_wpo.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/GL') + + ninja_file = test.built_file_path('obj/test_opt_sp.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/GF') + + ninja_file = test.built_file_path('obj/test_opt_sp_off.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/GF') + + ninja_file = test.built_file_path('obj/test_opt_fso.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/GT') + + ninja_file = test.built_file_path('obj/test_opt_fso_off.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/GT') + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-pdbname-override.py b/third_party/python/gyp/test/win/gyptest-cl-pdbname-override.py new file mode 100644 index 0000000000..da9b49af16 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-pdbname-override.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure pdb is named as expected (shared between .cc files). +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('pdbname-override.gyp', chdir=CHDIR) + test.build('pdbname-override.gyp', test.ALL, chdir=CHDIR) + + # Confirm that the pdb generated by the compiler was renamed (and we also + # have the linker generated one). + test.built_file_must_exist('compiler_generated.pdb', chdir=CHDIR) + test.built_file_must_exist('linker_generated.pdb', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-pdbname.py b/third_party/python/gyp/test/win/gyptest-cl-pdbname.py new file mode 100644 index 0000000000..f09ac233cd --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-pdbname.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure pdb is named as expected (shared between .cc files). +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('pdbname.gyp', chdir=CHDIR) + test.build('pdbname.gyp', test.ALL, chdir=CHDIR) + + # Confirm that the default behaviour is to name the .pdb per-target (rather + # than per .cc file). + test.built_file_must_exist('obj/test_pdbname.cc.pdb', chdir=CHDIR) + + # Confirm that there should be a .pdb alongside the executable. + test.built_file_must_exist('test_pdbname.exe', chdir=CHDIR) + test.built_file_must_exist('test_pdbname.exe.pdb', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-rtti.py b/third_party/python/gyp/test/win/gyptest-cl-rtti.py new file mode 100644 index 0000000000..d49a094379 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-rtti.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure RTTI setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('rtti.gyp', chdir=CHDIR) + + # Must fail. + test.build('rtti.gyp', 'test_rtti_off', chdir=CHDIR, status=1) + + # Must succeed. + test.build('rtti.gyp', 'test_rtti_on', chdir=CHDIR) + + # Must succeed. + test.build('rtti.gyp', 'test_rtti_unset', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-runtime-checks.py b/third_party/python/gyp/test/win/gyptest-cl-runtime-checks.py new file mode 100644 index 0000000000..4fd529f892 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-runtime-checks.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure RTC setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('runtime-checks.gyp', chdir=CHDIR) + + # Runtime checks disabled, should fail. + test.build('runtime-checks.gyp', 'test_brc_none', chdir=CHDIR, status=1) + + # Runtime checks enabled, should pass. + test.build('runtime-checks.gyp', 'test_brc_1', chdir=CHDIR) + + # TODO(scottmg): There are other less frequently used/partial options, but + # it's not clear how to verify them, so ignore for now. + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-runtime-library.py b/third_party/python/gyp/test/win/gyptest-cl-runtime-library.py new file mode 100644 index 0000000000..53c149297b --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-runtime-library.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure runtime C library setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('runtime-library.gyp', chdir=CHDIR) + test.build('runtime-library.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py b/third_party/python/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py new file mode 100644 index 0000000000..ca35fb55a0 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure TreatWChar_tAsBuiltInType option is functional. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('treat-wchar-t-as-built-in-type.gyp', chdir=CHDIR) + test.build('treat-wchar-t-as-built-in-type.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-warning-as-error.py b/third_party/python/gyp/test/win/gyptest-cl-warning-as-error.py new file mode 100644 index 0000000000..d4ef1b362b --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-warning-as-error.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure warning-as-error is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('warning-as-error.gyp', chdir=CHDIR) + + # The source file contains a warning, so if WarnAsError is false (or + # default, which is also false), then the build should succeed, otherwise it + # must fail. + + test.build('warning-as-error.gyp', 'test_warn_as_error_false', chdir=CHDIR) + test.build('warning-as-error.gyp', 'test_warn_as_error_unset', chdir=CHDIR) + test.build('warning-as-error.gyp', 'test_warn_as_error_true', chdir=CHDIR, + status=1) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-cl-warning-level.py b/third_party/python/gyp/test/win/gyptest-cl-warning-level.py new file mode 100644 index 0000000000..62a5b39b6a --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-cl-warning-level.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure warning level is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('warning-level.gyp', chdir=CHDIR) + + # A separate target for each warning level: one pass (compiling a file + # containing a warning that's above the specified level); and one fail + # (compiling a file at the specified level). No pass for 4 of course, + # because it would have to have no warnings. The default warning level is + # equivalent to level 1. + + test.build('warning-level.gyp', 'test_wl1_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_wl1_pass', chdir=CHDIR) + + test.build('warning-level.gyp', 'test_wl2_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_wl2_pass', chdir=CHDIR) + + test.build('warning-level.gyp', 'test_wl3_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_wl3_pass', chdir=CHDIR) + + test.build('warning-level.gyp', 'test_wl4_fail', chdir=CHDIR, status=1) + + test.build('warning-level.gyp', 'test_def_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_def_pass', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-command-quote.py b/third_party/python/gyp/test/win/gyptest-command-quote.py new file mode 100644 index 0000000000..656a69da53 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-command-quote.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +# 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. + +""" + +Make sure the program in a command can be a called batch file, or an +application in the path. Specifically, this means not quoting something like +"call x.bat", lest the shell look for a program named "call x.bat", rather +than calling "x.bat". +""" + +from __future__ import print_function + +import TestGyp + +import sys + +if sys.platform == 'win32': + print("This test is currently disabled: https://crbug.com/483696.") + sys.exit(0) + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'command-quote' + test.run_gyp('command-quote.gyp', chdir=CHDIR) + + test.build('command-quote.gyp', 'test_batch', chdir=CHDIR) + test.build('command-quote.gyp', 'test_call_separate', chdir=CHDIR) + test.build('command-quote.gyp', 'test_with_double_quotes', chdir=CHDIR) + test.build('command-quote.gyp', 'test_with_single_quotes', chdir=CHDIR) + + # We confirm that this fails because other generators don't handle spaces in + # inputs so it's preferable to not have it work here. + test.build('command-quote.gyp', 'test_with_spaces', chdir=CHDIR, status=1) + + CHDIR = 'command-quote/subdir/and/another' + test.run_gyp('in-subdir.gyp', chdir=CHDIR) + test.build('in-subdir.gyp', 'test_batch_depth', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-crosscompile-ar.py b/third_party/python/gyp/test/win/gyptest-crosscompile-ar.py new file mode 100644 index 0000000000..dc75d96a84 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-crosscompile-ar.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Copyright 2015 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. + +""" +Verifies that ar_host is set correctly when enabling cross-compile on windows. +""" + +import TestGyp + +import sys +import os + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'lib-crosscompile' + oldenv = os.environ.copy() + try: + os.environ['GYP_CROSSCOMPILE'] = '1' + test.run_gyp('use_host_ar.gyp', chdir=CHDIR) + finally: + os.environ.clear() + os.environ.update(oldenv) + + test.build('use_host_ar.gyp', test.ALL, chdir=CHDIR) + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-lib-ltcg.py b/third_party/python/gyp/test/win/gyptest-lib-ltcg.py new file mode 100644 index 0000000000..d1d7bad840 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-lib-ltcg.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure LTCG setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'lib-flags' + test.run_gyp('ltcg.gyp', chdir=CHDIR) + test.build('ltcg.gyp', test.ALL, chdir=CHDIR) + test.must_not_contain_any_line(test.stdout(), ['restarting link with /LTCG']) + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-additional-deps.py b/third_party/python/gyp/test/win/gyptest-link-additional-deps.py new file mode 100644 index 0000000000..62c57366f9 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-additional-deps.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure additional library dependencies are handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('additional-deps.gyp', chdir=CHDIR) + test.build('additional-deps.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-additional-options.py b/third_party/python/gyp/test/win/gyptest-link-additional-options.py new file mode 100644 index 0000000000..7e57ae4764 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-additional-options.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure additional options are handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('additional-options.gyp', chdir=CHDIR) + test.build('additional-options.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-aslr.py b/third_party/python/gyp/test/win/gyptest-link-aslr.py new file mode 100644 index 0000000000..e765017d3b --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-aslr.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure aslr setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('aslr.gyp', chdir=CHDIR) + test.build('aslr.gyp', test.ALL, chdir=CHDIR) + + def HasDynamicBase(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/headers', full_path) + return ' Dynamic base' in output + + # Default is to be on. + if not HasDynamicBase('test_aslr_default.exe'): + test.fail_test() + if HasDynamicBase('test_aslr_no.exe'): + test.fail_test() + if not HasDynamicBase('test_aslr_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-base-address.py b/third_party/python/gyp/test/win/gyptest-link-base-address.py new file mode 100644 index 0000000000..d58527ad7e --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-base-address.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# Copyright 2013 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. + +""" +Make sure the base address setting is extracted properly. +""" + +import TestGyp + +import re +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('base-address.gyp', chdir=CHDIR) + test.build('base-address.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + return test.run_dumpbin('/headers', full_path) + + # Extract the image base address from the headers output. + image_base_reg_ex = re.compile(r'.*\s+([0-9]+) image base.*', re.DOTALL) + + exe_headers = GetHeaders('test_base_specified_exe.exe') + exe_match = image_base_reg_ex.match(exe_headers) + + if not exe_match or not exe_match.group(1): + test.fail_test() + if exe_match.group(1) != '420000': + test.fail_test() + + dll_headers = GetHeaders('test_base_specified_dll.dll') + dll_match = image_base_reg_ex.match(dll_headers) + + if not dll_match or not dll_match.group(1): + test.fail_test() + if dll_match.group(1) != '10420000': + test.fail_test() + + default_exe_headers = GetHeaders('test_base_default_exe.exe') + default_exe_match = image_base_reg_ex.match(default_exe_headers) + + if not default_exe_match or not default_exe_match.group(1): + test.fail_test() + if default_exe_match.group(1) != '400000': + test.fail_test() + + default_dll_headers = GetHeaders('test_base_default_dll.dll') + default_dll_match = image_base_reg_ex.match(default_dll_headers) + + if not default_dll_match or not default_dll_match.group(1): + test.fail_test() + if default_dll_match.group(1) != '10000000': + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-debug-info.py b/third_party/python/gyp/test/win/gyptest-link-debug-info.py new file mode 100644 index 0000000000..33e8ac48bf --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-debug-info.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure debug info setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('debug-info.gyp', chdir=CHDIR) + test.build('debug-info.gyp', test.ALL, chdir=CHDIR) + + suffix = '.exe.pdb' if test.format == 'ninja' else '.pdb' + test.built_file_must_not_exist('test_debug_off%s' % suffix, chdir=CHDIR) + test.built_file_must_exist('test_debug_on%s' % suffix, chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-default-libs.py b/third_party/python/gyp/test/win/gyptest-link-default-libs.py new file mode 100644 index 0000000000..5edf467913 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-default-libs.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure we include the default libs. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('no-default-libs.gyp', chdir=CHDIR) + test.build('no-default-libs.gyp', test.ALL, chdir=CHDIR, status=1) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-deffile.py b/third_party/python/gyp/test/win/gyptest-link-deffile.py new file mode 100644 index 0000000000..94df874f85 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-deffile.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure a .def file is handled in the link. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + + # Multiple .def files doesn't make any sense, should fail at generate time. + test.run_gyp('deffile-multiple.gyp', chdir=CHDIR, stderr=None, status=1) + + test.run_gyp('deffile.gyp', chdir=CHDIR) + test.build('deffile.gyp', test.ALL, chdir=CHDIR) + + def HasExport(binary, export): + full_path = test.built_file_path(binary, chdir=CHDIR) + output = test.run_dumpbin('/exports', full_path) + return export in output + + # Make sure we only have the export when the .def file is in use. + + if HasExport('test_deffile_dll_notexported.dll', 'AnExportedFunction'): + test.fail_test() + if not HasExport('test_deffile_dll_ok.dll', 'AnExportedFunction'): + test.fail_test() + + if HasExport('test_deffile_exe_notexported.exe', 'AnExportedFunction'): + test.fail_test() + if not HasExport('test_deffile_exe_ok.exe', 'AnExportedFunction'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-defrelink.py b/third_party/python/gyp/test/win/gyptest-link-defrelink.py new file mode 100644 index 0000000000..cb3f86bb0e --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-defrelink.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure a relink is performed when a .def file is touched. +""" + +from __future__ import print_function + +import TestGyp + +import sys + +if sys.platform == 'win32': + print("This test is currently disabled: https://crbug.com/483696.") + sys.exit(0) + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + target = 'test_deffile_dll_ok' + def_contents = test.read('linker-flags/deffile.def') + + # This first build makes sure everything is up to date. + test.run_gyp('deffile.gyp', chdir=CHDIR) + test.build('deffile.gyp', target, chdir=CHDIR) + test.up_to_date('deffile.gyp', target, chdir=CHDIR) + + def HasExport(binary, export): + full_path = test.built_file_path(binary, chdir=CHDIR) + output = test.run_dumpbin('/exports', full_path) + return export in output + + # Verify that only one function is exported. + if not HasExport('test_deffile_dll_ok.dll', 'AnExportedFunction'): + test.fail_test() + if HasExport('test_deffile_dll_ok.dll', 'AnotherExportedFunction'): + test.fail_test() + + # Add AnotherExportedFunction to the def file, then rebuild. If it doesn't + # relink the DLL, then the subsequent check for AnotherExportedFunction will + # fail. + new_def_contents = def_contents + "\n AnotherExportedFunction" + test.write('linker-flags/deffile.def', new_def_contents) + test.build('deffile.gyp', target, chdir=CHDIR) + test.up_to_date('deffile.gyp', target, chdir=CHDIR) + + if not HasExport('test_deffile_dll_ok.dll', 'AnExportedFunction'): + test.fail_test() + if not HasExport('test_deffile_dll_ok.dll', 'AnotherExportedFunction'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-delay-load-dlls.py b/third_party/python/gyp/test/win/gyptest-link-delay-load-dlls.py new file mode 100644 index 0000000000..3880247b4a --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-delay-load-dlls.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure delay load setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('delay-load-dlls.gyp', chdir=CHDIR) + test.build('delay-load-dlls.gyp', test.ALL, chdir=CHDIR) + + prefix = 'contains the following delay load imports:' + shell32_look_for = prefix + '\r\n\r\n SHELL32.dll' + + output = test.run_dumpbin( + '/all', test.built_file_path('test_dld_none.exe', chdir=CHDIR)) + if prefix in output: + test.fail_test() + + output = test.run_dumpbin( + '/all', test.built_file_path('test_dld_shell32.exe', chdir=CHDIR)) + if shell32_look_for not in output: + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-embed-manifest.py b/third_party/python/gyp/test/win/gyptest-link-embed-manifest.py new file mode 100644 index 0000000000..0e2b628be1 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-embed-manifest.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 Yandex LLC. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +Make sure manifests are embedded in binaries properly. Handling of +AdditionalManifestFiles is tested too. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource( + handle, RT_MANIFEST, resource_name).decode('utf-8', 'ignore') + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'linker-flags' + test.run_gyp('embed-manifest.gyp', chdir=CHDIR) + test.build('embed-manifest.gyp', test.ALL, chdir=CHDIR) + + # The following binaries must contain a manifest embedded. + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_exe.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_exe_inc.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_dll.dll', chdir=CHDIR), 2)) + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_dll_inc.dll', chdir=CHDIR), 2)) + + # Must contain the Win7 support GUID, but not the Vista one (from + # extra2.manifest). + test.fail_test( + '35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in + extract_manifest(test.built_file_path('test_manifest_extra1.exe', + chdir=CHDIR), 1)) + test.fail_test( + 'e2011457-1546-43c5-a5fe-008deee3d3f0' in + extract_manifest(test.built_file_path('test_manifest_extra1.exe', + chdir=CHDIR), 1)) + # Must contain both. + test.fail_test( + '35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in + extract_manifest(test.built_file_path('test_manifest_extra2.exe', + chdir=CHDIR), 1)) + test.fail_test( + 'e2011457-1546-43c5-a5fe-008deee3d3f0' not in + extract_manifest(test.built_file_path('test_manifest_extra2.exe', + chdir=CHDIR), 1)) + + # Same as extra2, but using list syntax instead. + test.fail_test( + '35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in + extract_manifest(test.built_file_path('test_manifest_extra_list.exe', + chdir=CHDIR), 1)) + test.fail_test( + 'e2011457-1546-43c5-a5fe-008deee3d3f0' not in + extract_manifest(test.built_file_path('test_manifest_extra_list.exe', + chdir=CHDIR), 1)) + + # Test that incremental linking doesn't force manifest embedding. + test.fail_test(extract_manifest(test.built_file_path( + 'test_manifest_exe_inc_no_embed.exe', chdir=CHDIR), 1)) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-enable-uac.py b/third_party/python/gyp/test/win/gyptest-link-enable-uac.py new file mode 100644 index 0000000000..0ddbde5fa5 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-enable-uac.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python + +# Copyright 2013 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. + +""" +Verifies that embedding UAC information into the manifest works. +""" + +import TestGyp + +import sys +from xml.dom.minidom import parseString + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource(handle, RT_MANIFEST, resource_name) + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'linker-flags' + test.run_gyp('enable-uac.gyp', chdir=CHDIR) + test.build('enable-uac.gyp', test.ALL, chdir=CHDIR) + + # The following binaries must contain a manifest embedded. + test.fail_test(not extract_manifest(test.built_file_path( + 'enable_uac.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'enable_uac_no.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'enable_uac_admin.exe', chdir=CHDIR), 1)) + + # Verify that + # is present. + manifest = parseString(extract_manifest( + test.built_file_path('enable_uac.exe', chdir=CHDIR), 1)) + execution_level = manifest.getElementsByTagName('requestedExecutionLevel') + test.fail_test(len(execution_level) != 1) + execution_level = execution_level[0].attributes + + def _has_key(node, key): + # 'in' doesn't work with the NamedNodeMap interface in Python2, + # but 'has_key' was removed from it in Python3, so we need to + # shim things :(. + if hasattr(node, 'has_key'): + return node.has_key(key) + return key in node + + test.fail_test(not ( + _has_key(execution_level, 'level') and + _has_key(execution_level, 'uiAccess') and + execution_level['level'].nodeValue == 'asInvoker' and + execution_level['uiAccess'].nodeValue == 'false')) + + # Verify that is not in the menifest. + manifest = parseString(extract_manifest( + test.built_file_path('enable_uac_no.exe', chdir=CHDIR), 1)) + execution_level = manifest.getElementsByTagName('requestedExecutionLevel') + test.fail_test(len(execution_level) != 0) + + # Verify that is present. + manifest = parseString(extract_manifest( + test.built_file_path('enable_uac_admin.exe', chdir=CHDIR), 1)) + execution_level = manifest.getElementsByTagName('requestedExecutionLevel') + test.fail_test(len(execution_level) != 1) + execution_level = execution_level[0].attributes + test.fail_test(not ( + _has_key(execution_level, 'level') and + _has_key(execution_level, 'uiAccess') and + execution_level['level'].nodeValue == 'requireAdministrator' and + execution_level['uiAccess'].nodeValue == 'true')) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-enable-winrt-app-revision.py b/third_party/python/gyp/test/win/gyptest-link-enable-winrt-app-revision.py new file mode 100644 index 0000000000..45d86e1c69 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-enable-winrt-app-revision.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure msvs_application_type_revision works correctly. +""" + +from __future__ import print_function + +import TestGyp + +import os +import sys +import struct + +CHDIR = 'winrt-app-type-revision' + +print('This test is not currently working on the bots: https://code.google.com/p/gyp/issues/detail?id=466') +sys.exit(0) + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) == 2013): + test = TestGyp.TestGyp(formats=['msvs']) + + test.run_gyp('winrt-app-type-revision.gyp', chdir=CHDIR) + + test.build('winrt-app-type-revision.gyp', 'enable_winrt_81_revision_dll', + chdir=CHDIR) + + # Revision is set to 8.2 which is invalid for 2013 projects so compilation + # must fail. + test.build('winrt-app-type-revision.gyp', 'enable_winrt_82_revision_dll', + chdir=CHDIR, status=1) + + # Revision is set to an invalid value for 2013 projects so compilation + # must fail. + test.build('winrt-app-type-revision.gyp', 'enable_winrt_invalid_revision_dll', + chdir=CHDIR, status=1) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py b/third_party/python/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py new file mode 100644 index 0000000000..877cb68f8c --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure msvs_target_platform_version works correctly. +""" + +from __future__ import print_function + +import TestGyp + +import os +import sys +import struct + +CHDIR = 'winrt-target-platform-version' + +print('This test is not currently working on the bots: https://code.google.com/p/gyp/issues/detail?id=466') +sys.exit(0) + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) == 2015): + test = TestGyp.TestGyp(formats=['msvs']) + + test.run_gyp('winrt-target-platform-version.gyp', chdir=CHDIR) + + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_10_platversion_dll', chdir=CHDIR) + + # Target Platform without Minimum Target Platform version defaults to a valid + # Target Platform and compiles. + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_10_platversion_nominver_dll', chdir=CHDIR) + + # Target Platform is set to 9.0 which is invalid for 2015 projects so + # compilation must fail. + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_9_platversion_dll', chdir=CHDIR, status=1) + + # Missing Target Platform for 2015 projects must fail. + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_missing_platversion_dll', chdir=CHDIR, status=1) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-enable-winrt.py b/third_party/python/gyp/test/win/gyptest-link-enable-winrt.py new file mode 100644 index 0000000000..5e0493aade --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-enable-winrt.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure msvs_enable_winrt works correctly. +""" + +from __future__ import print_function + +import TestGyp + +import os +import sys +import struct + +CHDIR = 'enable-winrt' + +print('This test is not currently working on the bots: https://code.google.com/p/gyp/issues/detail?id=466') +sys.exit(0) + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2013): + test = TestGyp.TestGyp(formats=['msvs']) + + test.run_gyp('enable-winrt.gyp', chdir=CHDIR) + + test.build('enable-winrt.gyp', 'enable_winrt_dll', chdir=CHDIR) + + test.build('enable-winrt.gyp', 'enable_winrt_missing_dll', chdir=CHDIR, + status=1) + + test.build('enable-winrt.gyp', 'enable_winrt_winphone_dll', chdir=CHDIR) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-entrypointsymbol.py b/third_party/python/gyp/test/win/gyptest-link-entrypointsymbol.py new file mode 100644 index 0000000000..e88174a085 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-entrypointsymbol.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure entrypointsymbol setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('entrypointsymbol.gyp', chdir=CHDIR) + + test.build('entrypointsymbol.gyp', 'test_ok', chdir=CHDIR) + test.build('entrypointsymbol.gyp', 'test_fail', chdir=CHDIR, status=1) + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-fixed-base.py b/third_party/python/gyp/test/win/gyptest-link-fixed-base.py new file mode 100644 index 0000000000..725a87028a --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-fixed-base.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure fixed base setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('fixed-base.gyp', chdir=CHDIR) + test.build('fixed-base.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + return test.run_dumpbin('/headers', full_path) + + # For exe, default is fixed, for dll, it's not fixed. + if 'Relocations stripped' not in GetHeaders('test_fixed_default_exe.exe'): + test.fail_test() + if 'Relocations stripped' in GetHeaders('test_fixed_default_dll.dll'): + test.fail_test() + + # Explicitly not fixed. + if 'Relocations stripped' in GetHeaders('test_fixed_no.exe'): + test.fail_test() + + # Explicitly fixed. + if 'Relocations stripped' not in GetHeaders('test_fixed_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-force-symbol-reference.py b/third_party/python/gyp/test/win/gyptest-link-force-symbol-reference.py new file mode 100644 index 0000000000..235e94f71b --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-force-symbol-reference.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure ForceSymbolReference is translated properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('force-symbol-reference.gyp', chdir=CHDIR) + test.build('force-symbol-reference.gyp', test.ALL, chdir=CHDIR) + + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_force_reference.exe', chdir=CHDIR)) + if '?x@@YAHXZ:' not in output or '?y@@YAHXZ:' not in output: + test.fail_test() + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-generate-manifest.py b/third_party/python/gyp/test/win/gyptest-link-generate-manifest.py new file mode 100644 index 0000000000..77c9228ee5 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-generate-manifest.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure we generate a manifest file when linking binaries, including +handling AdditionalManifestFiles. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource(handle, RT_MANIFEST, resource_name) + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('generate-manifest.gyp', chdir=CHDIR) + test.build('generate-manifest.gyp', test.ALL, chdir=CHDIR) + + # Make sure that generation of .generated.manifest does not cause a relink. + test.run_gyp('generate-manifest.gyp', chdir=CHDIR) + test.up_to_date('generate-manifest.gyp', test.ALL, chdir=CHDIR) + + def test_manifest(filename, generate_manifest, embedded_manifest, + extra_manifest): + exe_file = test.built_file_path(filename, chdir=CHDIR) + if not generate_manifest: + test.must_not_exist(exe_file + '.manifest') + manifest = extract_manifest(exe_file, 1) + test.fail_test(manifest) + return + if embedded_manifest: + manifest = extract_manifest(exe_file, 1) + test.fail_test(not manifest) + else: + test.must_exist(exe_file + '.manifest') + manifest = test.read(exe_file + '.manifest') + test.fail_test(not manifest) + test.fail_test(extract_manifest(exe_file, 1)) + if generate_manifest: + test.must_contain_any_line(manifest, 'requestedExecutionLevel') + if extra_manifest: + test.must_contain_any_line(manifest, + '35138b9a-5d96-4fbd-8e2d-a2440225f93a') + test.must_contain_any_line(manifest, + 'e2011457-1546-43c5-a5fe-008deee3d3f0') + + test_manifest('test_generate_manifest_true.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=False) + test_manifest('test_generate_manifest_false.exe', + generate_manifest=False, + embedded_manifest=False, + extra_manifest=False) + test_manifest('test_generate_manifest_default.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=False) + test_manifest('test_generate_manifest_true_as_embedded.exe', + generate_manifest=True, + embedded_manifest=True, + extra_manifest=False) + test_manifest('test_generate_manifest_false_as_embedded.exe', + generate_manifest=False, + embedded_manifest=True, + extra_manifest=False) + test_manifest('test_generate_manifest_default_as_embedded.exe', + generate_manifest=True, + embedded_manifest=True, + extra_manifest=False) + test_manifest('test_generate_manifest_true_with_extra_manifest.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_false_with_extra_manifest.exe', + generate_manifest=False, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_true_with_extra_manifest_list.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_false_with_extra_manifest_list.exe', + generate_manifest=False, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_default_embed_default.exe', + generate_manifest=True, + embedded_manifest=True, + extra_manifest=False) + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-incremental.py b/third_party/python/gyp/test/win/gyptest-link-incremental.py new file mode 100644 index 0000000000..e7184e162c --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-incremental.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure incremental linking setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('incremental.gyp', chdir=CHDIR) + test.build('incremental.gyp', test.ALL, chdir=CHDIR) + + def HasILTTables(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/disasm', full_path) + return '@ILT+' in output + + # Default or unset is to be on. + if not HasILTTables('test_incremental_unset.exe'): + test.fail_test() + if not HasILTTables('test_incremental_default.exe'): + test.fail_test() + if HasILTTables('test_incremental_no.exe'): + test.fail_test() + if not HasILTTables('test_incremental_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-large-address-aware.py b/third_party/python/gyp/test/win/gyptest-link-large-address-aware.py new file mode 100644 index 0000000000..ea433f2099 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-large-address-aware.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +# 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. + +""" +Make sure largeaddressaware setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('large-address-aware.gyp', chdir=CHDIR) + test.build('large-address-aware.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR)) + + MARKER = 'Application can handle large (>2GB) addresses' + + # Explicitly off. + if MARKER in GetHeaders('test_large_address_aware_no.exe'): + test.fail_test() + + # Explicitly on. + if MARKER not in GetHeaders('test_large_address_aware_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/gyptest-link-large-pdb.py b/third_party/python/gyp/test/win/gyptest-link-large-pdb.py new file mode 100644 index 0000000000..1fb27b0ab7 --- /dev/null +++ b/third_party/python/gyp/test/win/gyptest-link-large-pdb.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +""" +Make sure msvs_large_pdb works correctly. +""" + +from __future__ import print_function + +import TestGyp + +import struct +import sys + +if sys.platform == 'win32': + print("This test is currently disabled: https://crbug.com/483696.") + sys.exit(0) + + +CHDIR = 'large-pdb' + + +def CheckImageAndPdb(test, image_basename, expected_page_size, + pdb_basename=None): + if not pdb_basename: + pdb_basename = image_basename + '.pdb' + test.built_file_must_exist(image_basename, chdir=CHDIR) + test.built_file_must_exist(pdb_basename, chdir=CHDIR) + + # We expect the PDB to have the given page size. For full details of the + # header look here: https://code.google.com/p/pdbparser/wiki/MSF_Format + # We read the little-endian 4-byte unsigned integer at position 32 of the + # file. + pdb_path = test.built_file_path(pdb_basename, chdir=CHDIR) + pdb_file = open(pdb_path, 'rb') + pdb_file.seek(32, 0) + page_size = struct.unpack('(indexer)); + return 0; +} diff --git a/third_party/python/gyp/test/win/idl-rules/idl_compiler.py b/third_party/python/gyp/test/win/idl-rules/idl_compiler.py new file mode 100644 index 0000000000..a12b274d67 --- /dev/null +++ b/third_party/python/gyp/test/win/idl-rules/idl_compiler.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +# Copyright (c) 2014 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. + +# mock, just outputs empty .h/.cpp files + +import os +import sys + +if len(sys.argv) == 2: + basename, ext = os.path.splitext(sys.argv[1]) + with open('%s.h' % basename, 'w') as f: + f.write('// %s.h\n' % basename) + with open('%s.cpp' % basename, 'w') as f: + f.write('// %s.cpp\n' % basename) diff --git a/third_party/python/gyp/test/win/importlib/dll_no_exports.cc b/third_party/python/gyp/test/win/importlib/dll_no_exports.cc new file mode 100644 index 0000000000..96dd7970b7 --- /dev/null +++ b/third_party/python/gyp/test/win/importlib/dll_no_exports.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2015 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. + +#include + +BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/third_party/python/gyp/test/win/importlib/has-exports.cc b/third_party/python/gyp/test/win/importlib/has-exports.cc new file mode 100644 index 0000000000..3f62d6c60d --- /dev/null +++ b/third_party/python/gyp/test/win/importlib/has-exports.cc @@ -0,0 +1,10 @@ +// 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. + +__declspec(dllexport) void some_function() { +} + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/importlib/hello.cc b/third_party/python/gyp/test/win/importlib/hello.cc new file mode 100644 index 0000000000..66ff68c113 --- /dev/null +++ b/third_party/python/gyp/test/win/importlib/hello.cc @@ -0,0 +1,9 @@ +// 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. + +__declspec(dllimport) void some_function(); + +int main() { + some_function(); +} diff --git a/third_party/python/gyp/test/win/importlib/importlib.gyp b/third_party/python/gyp/test/win/importlib/importlib.gyp new file mode 100644 index 0000000000..ab15b1893d --- /dev/null +++ b/third_party/python/gyp/test/win/importlib/importlib.gyp @@ -0,0 +1,30 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_importlib', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + } + }, + 'sources': ['has-exports.cc'], + }, + + { + 'target_name': 'test_linkagainst', + 'type': 'executable', + 'dependencies': ['test_importlib'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/importlib/noimplib.gyp b/third_party/python/gyp/test/win/importlib/noimplib.gyp new file mode 100644 index 0000000000..0245058a99 --- /dev/null +++ b/third_party/python/gyp/test/win/importlib/noimplib.gyp @@ -0,0 +1,16 @@ +# Copyright (c) 2015 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. + +{ + 'targets': [ + { + 'target_name': 'no_import_library', + 'type': 'loadable_module', + 'msvs_settings': { + 'NoImportLibrary': 'true', + }, + 'sources': ['dll_no_exports.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/large-pdb/dllmain.cc b/third_party/python/gyp/test/win/large-pdb/dllmain.cc new file mode 100644 index 0000000000..14875623e8 --- /dev/null +++ b/third_party/python/gyp/test/win/large-pdb/dllmain.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2013 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. + +#include + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/third_party/python/gyp/test/win/large-pdb/large-pdb.gyp b/third_party/python/gyp/test/win/large-pdb/large-pdb.gyp new file mode 100644 index 0000000000..2a241a5623 --- /dev/null +++ b/third_party/python/gyp/test/win/large-pdb/large-pdb.gyp @@ -0,0 +1,98 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'large_pdb_exe', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/large_pdb_exe.exe.pdb', + }, + }, + }, + { + 'target_name': 'small_pdb_exe', + 'type': 'executable', + 'msvs_large_pdb': 0, + 'sources': [ + 'main.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/small_pdb_exe.exe.pdb', + }, + }, + }, + { + 'target_name': 'large_pdb_dll', + 'type': 'shared_library', + 'msvs_large_pdb': 1, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/large_pdb_dll.dll.pdb', + }, + }, + }, + { + 'target_name': 'small_pdb_dll', + 'type': 'shared_library', + 'msvs_large_pdb': 0, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/small_pdb_dll.dll.pdb', + }, + }, + }, + { + 'target_name': 'large_pdb_implicit_exe', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + # No PDB file is specified. However, the msvs_large_pdb mechanism should + # default to the appropriate <(PRODUCT_DIR)/<(TARGET_NAME).exe.pdb. + }, + { + 'target_name': 'large_pdb_variable_exe', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + # No PDB file is specified. However, the msvs_large_pdb_path variable + # explicitly sets one. + 'variables': { + 'msvs_large_pdb_path': '<(PRODUCT_DIR)/foo.pdb', + }, + }, + { + 'target_name': 'large_pdb_product_exe', + 'product_name': 'bar', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + # No PDB file is specified. However, we've specified a product name so + # it should use <(PRODUCT_DIR)/bar.exe.pdb. + }, + ] +} diff --git a/third_party/python/gyp/test/win/large-pdb/main.cc b/third_party/python/gyp/test/win/large-pdb/main.cc new file mode 100644 index 0000000000..c3da8e9219 --- /dev/null +++ b/third_party/python/gyp/test/win/large-pdb/main.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int main(void) { + return 0; +} diff --git a/third_party/python/gyp/test/win/lib-crosscompile/answer.cc b/third_party/python/gyp/test/win/lib-crosscompile/answer.cc new file mode 100644 index 0000000000..a6ffa16862 --- /dev/null +++ b/third_party/python/gyp/test/win/lib-crosscompile/answer.cc @@ -0,0 +1,9 @@ +// 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. + +#include "answer.h" + +int answer() { + return 42; +} diff --git a/third_party/python/gyp/test/win/lib-crosscompile/answer.h b/third_party/python/gyp/test/win/lib-crosscompile/answer.h new file mode 100644 index 0000000000..82312d54b8 --- /dev/null +++ b/third_party/python/gyp/test/win/lib-crosscompile/answer.h @@ -0,0 +1,5 @@ +// 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. + +int answer(); \ No newline at end of file diff --git a/third_party/python/gyp/test/win/lib-crosscompile/use_host_ar.gyp b/third_party/python/gyp/test/win/lib-crosscompile/use_host_ar.gyp new file mode 100644 index 0000000000..4747bc6445 --- /dev/null +++ b/third_party/python/gyp/test/win/lib-crosscompile/use_host_ar.gyp @@ -0,0 +1,17 @@ +# Copyright (c) 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'lib_answer', + 'type': 'static_library', + 'toolsets': ['host'], + 'msvs_settings': { + 'msvs_cygwin_shell': 0, + }, + 'sources': ['answer.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/lib-flags/answer.cc b/third_party/python/gyp/test/win/lib-flags/answer.cc new file mode 100644 index 0000000000..a6ffa16862 --- /dev/null +++ b/third_party/python/gyp/test/win/lib-flags/answer.cc @@ -0,0 +1,9 @@ +// 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. + +#include "answer.h" + +int answer() { + return 42; +} diff --git a/third_party/python/gyp/test/win/lib-flags/answer.h b/third_party/python/gyp/test/win/lib-flags/answer.h new file mode 100644 index 0000000000..82312d54b8 --- /dev/null +++ b/third_party/python/gyp/test/win/lib-flags/answer.h @@ -0,0 +1,5 @@ +// 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. + +int answer(); \ No newline at end of file diff --git a/third_party/python/gyp/test/win/lib-flags/ltcg.gyp b/third_party/python/gyp/test/win/lib-flags/ltcg.gyp new file mode 100644 index 0000000000..c183107730 --- /dev/null +++ b/third_party/python/gyp/test/win/lib-flags/ltcg.gyp @@ -0,0 +1,21 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'lib_answer', + 'type': 'static_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true', # /GL + }, + 'VCLibrarianTool': { + 'LinkTimeCodeGeneration': 'true', # /LTCG + }, + }, + 'sources': ['answer.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/a/x.cc b/third_party/python/gyp/test/win/linker-flags/a/x.cc new file mode 100644 index 0000000000..f5f763b095 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/a/x.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int x() { + return 1; +} diff --git a/third_party/python/gyp/test/win/linker-flags/a/z.cc b/third_party/python/gyp/test/win/linker-flags/a/z.cc new file mode 100644 index 0000000000..8a43501270 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/a/z.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int z() { + return 3; +} diff --git a/third_party/python/gyp/test/win/linker-flags/additional-deps.cc b/third_party/python/gyp/test/win/linker-flags/additional-deps.cc new file mode 100644 index 0000000000..7dfb589d26 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/additional-deps.cc @@ -0,0 +1,10 @@ +// 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. + +#include + +int main() { + WSAStartup(0, 0); + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/additional-deps.gyp b/third_party/python/gyp/test/win/linker-flags/additional-deps.gyp new file mode 100644 index 0000000000..55afe64fb0 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/additional-deps.gyp @@ -0,0 +1,30 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_deps_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_deps_few', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wininet.lib', + 'ws2_32.lib', + ] + } + }, + 'sources': ['additional-deps.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/additional-options.gyp b/third_party/python/gyp/test/win/linker-flags/additional-options.gyp new file mode 100644 index 0000000000..cab3994cd1 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/additional-options.gyp @@ -0,0 +1,29 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_additional_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_additional_few', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + '/dynamicbase:no', + ] + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/aslr.gyp b/third_party/python/gyp/test/win/linker-flags/aslr.gyp new file mode 100644 index 0000000000..b3aefd50b7 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/aslr.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_aslr_default', + 'type': 'executable', + 'msvs_settings': { + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_aslr_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_aslr_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '2', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/b/y.cc b/third_party/python/gyp/test/win/linker-flags/b/y.cc new file mode 100644 index 0000000000..bd884119fc --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/b/y.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int y() { + return 2; +} diff --git a/third_party/python/gyp/test/win/linker-flags/base-address.gyp b/third_party/python/gyp/test/win/linker-flags/base-address.gyp new file mode 100644 index 0000000000..873ebfea3f --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/base-address.gyp @@ -0,0 +1,38 @@ +# Copyright 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_base_specified_exe', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'BaseAddress': '0x00420000', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_base_specified_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'BaseAddress': '0x10420000', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_base_default_exe', + 'type': 'executable', + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_base_default_dll', + 'type': 'shared_library', + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/debug-info.gyp b/third_party/python/gyp/test/win/linker-flags/debug-info.gyp new file mode 100644 index 0000000000..d47d0ecced --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/debug-info.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_debug_off', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'false' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_debug_on', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true' + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp b/third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp new file mode 100644 index 0000000000..c74a9af20a --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/deffile-multiple.gyp @@ -0,0 +1,17 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_deffile_multiple_fail', + 'type': 'shared_library', + 'sources': [ + 'deffile.cc', + 'deffile.def', + 'deffile2.def', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/deffile.cc b/third_party/python/gyp/test/win/linker-flags/deffile.cc new file mode 100644 index 0000000000..fa203b34c8 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/deffile.cc @@ -0,0 +1,13 @@ +// 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. + +void AnExportedFunction() { +} + +void AnotherExportedFunction() { +} + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/deffile.def b/third_party/python/gyp/test/win/linker-flags/deffile.def new file mode 100644 index 0000000000..ba9d399bd6 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/deffile.def @@ -0,0 +1,8 @@ +; 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. + +LIBRARY test_deffile_ok + +EXPORTS + AnExportedFunction diff --git a/third_party/python/gyp/test/win/linker-flags/deffile.gyp b/third_party/python/gyp/test/win/linker-flags/deffile.gyp new file mode 100644 index 0000000000..7b241d5e3a --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/deffile.gyp @@ -0,0 +1,38 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_deffile_dll_ok', + 'type': 'shared_library', + 'sources': [ + 'deffile.cc', + 'deffile.def', + ], + }, + { + 'target_name': 'test_deffile_dll_notexported', + 'type': 'shared_library', + 'sources': [ + 'deffile.cc', + ], + }, + { + 'target_name': 'test_deffile_exe_ok', + 'type': 'executable', + 'sources': [ + 'deffile.cc', + 'deffile.def', + ], + }, + { + 'target_name': 'test_deffile_exe_notexported', + 'type': 'executable', + 'sources': [ + 'deffile.cc', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp b/third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp new file mode 100644 index 0000000000..671cbaa802 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/delay-load-dlls.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_dld_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + } + }, + 'sources': ['delay-load.cc'], + 'libraries': [ + 'delayimp.lib', + 'shell32.lib', + ], + }, + { + 'target_name': 'test_dld_shell32', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': ['shell32.dll'] + } + }, + 'sources': ['delay-load.cc'], + 'libraries': [ + 'delayimp.lib', + 'shell32.lib', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/delay-load.cc b/third_party/python/gyp/test/win/linker-flags/delay-load.cc new file mode 100644 index 0000000000..2be34aa876 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/delay-load.cc @@ -0,0 +1,10 @@ +// 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. + +#include + +int main() { + SHCreateDirectory(0, 0); + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp b/third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp new file mode 100644 index 0000000000..fefb2f56d8 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/embed-manifest.gyp @@ -0,0 +1,109 @@ +# Copyright (c) 2013 Yandex LLC. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'test_manifest_exe', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '1', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_dll', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '1', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_extra1', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': 'extra.manifest', + } + }, + }, + { + 'target_name': 'test_manifest_extra2', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest', + } + }, + }, + { + 'target_name': 'test_manifest_extra_list', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': [ + 'extra.manifest', + 'extra2.manifest' + ], + } + }, + }, + { + 'target_name': 'test_manifest_dll_inc', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_exe_inc', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_exe_inc_no_embed', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + } + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/enable-uac.gyp b/third_party/python/gyp/test/win/linker-flags/enable-uac.gyp new file mode 100644 index 0000000000..4e58c86ec8 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/enable-uac.gyp @@ -0,0 +1,45 @@ +# Copyright 2013 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. + +{ + 'targets': [ + { + 'target_name': 'enable_uac', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'enable_uac_no', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'enable_uac_admin', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'UACExecutionLevel': 2, + 'UACUIAccess': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc new file mode 100644 index 0000000000..b567bc87b3 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.cc @@ -0,0 +1,13 @@ +// 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. + +// The entry point specified by link.exe /ENTRY option. +extern "C" void MainEntryPoint() { +} + +// Still needed because the linker checks for existence of one of main, wmain, +// WinMain, or wMain to offer informative diagnositics. +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp new file mode 100644 index 0000000000..7f2c14252d --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/entrypointsymbol.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'EntryPointSymbol': 'MainEntryPoint', + } + }, + 'sources': ['entrypointsymbol.cc'], + }, + { + 'target_name': 'test_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'EntryPointSymbol': 'MainEntryPoint', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/extra.manifest b/third_party/python/gyp/test/win/linker-flags/extra.manifest new file mode 100644 index 0000000000..2e436dc251 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/extra.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/third_party/python/gyp/test/win/linker-flags/extra2.manifest b/third_party/python/gyp/test/win/linker-flags/extra2.manifest new file mode 100644 index 0000000000..bfb570ca59 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/extra2.manifest @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/third_party/python/gyp/test/win/linker-flags/fixed-base.gyp b/third_party/python/gyp/test/win/linker-flags/fixed-base.gyp new file mode 100644 index 0000000000..cc2982eb27 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/fixed-base.gyp @@ -0,0 +1,52 @@ +# 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. + +{ + 'targets': [ + # Disable DYNAMICBASE for these tests because it implies/doesn't imply + # FIXED in certain cases so it complicates the test for FIXED. + { + 'target_name': 'test_fixed_default_exe', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_fixed_default_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_fixed_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'FixedBaseAddress': '1', + 'RandomizedBaseAddress': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_fixed_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'FixedBaseAddress': '2', + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp b/third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp new file mode 100644 index 0000000000..d6d02a6848 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/force-symbol-reference.gyp @@ -0,0 +1,39 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_force_reference_lib', + 'type': 'static_library', + 'sources': ['x.cc', 'y.cc'], + }, + { + 'target_name': 'test_force_reference', + 'type': 'executable', + # Turn on debug info to get symbols in disasm for the test code, and + # turn on opt:ref to drop unused symbols to make sure we wouldn't + # otherwise have the symbols. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'AdditionalOptions': [ + '/OPT:REF', + ], + 'ForceSymbolReferences': [ + '?x@@YAHXZ', + '?y@@YAHXZ', + ], + }, + }, + 'sources': ['hello.cc'], + 'dependencies': [ + 'test_force_reference_lib', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp b/third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp new file mode 100644 index 0000000000..34a68d1a48 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/generate-manifest.gyp @@ -0,0 +1,166 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_generate_manifest_true', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_default', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_true_as_embedded', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false_as_embedded', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_default_as_embedded', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_true_with_extra_manifest', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false_with_extra_manifest', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_true_with_extra_manifest_list', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': [ + 'extra.manifest', + 'extra2.manifest', + ], + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false_with_extra_manifest_list', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': [ + 'extra.manifest', + 'extra2.manifest', + ], + }, + }, + }, + { + 'target_name': 'test_generate_manifest_default_embed_default', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/hello.cc b/third_party/python/gyp/test/win/linker-flags/hello.cc new file mode 100644 index 0000000000..1711567ef5 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/incremental.gyp b/third_party/python/gyp/test/win/linker-flags/incremental.gyp new file mode 100644 index 0000000000..59f3103253 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/incremental.gyp @@ -0,0 +1,65 @@ +# 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. + +{ + 'targets': [ + # Turn on debug information so the incremental linking tables have a + # visible symbolic name in the disassembly. + { + 'target_name': 'test_incremental_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_incremental_default', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '0', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_incremental_no', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_incremental_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '2', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/inline_test.cc b/third_party/python/gyp/test/win/linker-flags/inline_test.cc new file mode 100644 index 0000000000..a9f177e476 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/inline_test.cc @@ -0,0 +1,12 @@ +// Copyright (c) 2013 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. + +#include "inline_test.h" + +#include +#pragma intrinsic(_ReturnAddress) + +bool IsFunctionInlined(void* caller_return_address) { + return _ReturnAddress() == caller_return_address; +} diff --git a/third_party/python/gyp/test/win/linker-flags/inline_test.h b/third_party/python/gyp/test/win/linker-flags/inline_test.h new file mode 100644 index 0000000000..117913c4f5 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/inline_test.h @@ -0,0 +1,5 @@ +// Copyright (c) 2013 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. + +bool IsFunctionInlined(void* current_return_address); diff --git a/third_party/python/gyp/test/win/linker-flags/inline_test_main.cc b/third_party/python/gyp/test/win/linker-flags/inline_test_main.cc new file mode 100644 index 0000000000..23cafe8f94 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/inline_test_main.cc @@ -0,0 +1,15 @@ +// Copyright (c) 2013 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. + +#include "inline_test.h" + +#include +#include + +#pragma intrinsic(_ReturnAddress) + +int main() { + if (IsFunctionInlined(_ReturnAddress())) + puts("==== inlined ====\n"); +} diff --git a/third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp b/third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp new file mode 100644 index 0000000000..fa56d3789c --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/large-address-aware.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_large_address_aware_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LargeAddressAware': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_large_address_aware_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LargeAddressAware': '2', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/library-adjust.cc b/third_party/python/gyp/test/win/linker-flags/library-adjust.cc new file mode 100644 index 0000000000..7dfb589d26 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/library-adjust.cc @@ -0,0 +1,10 @@ +// 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. + +#include + +int main() { + WSAStartup(0, 0); + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/library-adjust.gyp b/third_party/python/gyp/test/win/linker-flags/library-adjust.gyp new file mode 100644 index 0000000000..10e9996f5c --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/library-adjust.gyp @@ -0,0 +1,16 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_adjust', + 'type': 'executable', + 'libraries': [ + '-lws2_32.lib' + ], + 'sources': ['library-adjust.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/library-directories-define.cc b/third_party/python/gyp/test/win/linker-flags/library-directories-define.cc new file mode 100644 index 0000000000..211ef062c1 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/library-directories-define.cc @@ -0,0 +1,7 @@ +// 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. + +int library_function() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc b/third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc new file mode 100644 index 0000000000..335097839a --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/library-directories-reference.cc @@ -0,0 +1,10 @@ +// 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. + +extern int library_function(); + +int main() { + library_function(); + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/library-directories.gyp b/third_party/python/gyp/test/win/linker-flags/library-directories.gyp new file mode 100644 index 0000000000..25395d6c87 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/library-directories.gyp @@ -0,0 +1,42 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_libdirs_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'test_lib.lib', + ], + }, + }, + 'sources': ['library-directories-reference.cc'], + }, + { + 'target_name': 'test_libdirs_with', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + # NOTE: Don't use this for general dependencies between gyp + # libraries (use 'dependencies' instead). This is done here only for + # testing. + # + # This setting should only be used to depend on third party prebuilt + # libraries that are stored as binaries at a known location. + 'AdditionalLibraryDirectories': [ + '<(DEPTH)/out/Default/obj/subdir', # ninja style + '<(DEPTH)/subdir/Default/lib', # msvs style + ], + 'AdditionalDependencies': [ + 'test_lib.lib', + ], + }, + }, + 'sources': ['library-directories-reference.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/link-ordering.gyp b/third_party/python/gyp/test/win/linker-flags/link-ordering.gyp new file mode 100644 index 0000000000..66f44309d1 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/link-ordering.gyp @@ -0,0 +1,95 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_ordering_exe', + 'type': 'executable', + # These are so the names of the functions appear in the disassembly. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'Optimization': '2', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + 'GenerateManifest': 'false', + # Minimize the disassembly to just our code. + 'AdditionalOptions': [ + '/NODEFAULTLIB', + ], + }, + }, + 'sources': [ + # Explicitly sorted the same way as the disassembly in the test .py. + 'main-crt.c', + 'z.cc', + 'x.cc', + 'y.cc', + 'hello.cc', + ], + }, + + { + 'target_name': 'test_ordering_subdirs', + 'type': 'executable', + # These are so the names of the functions appear in the disassembly. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'Optimization': '2', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + 'GenerateManifest': 'false', + # Minimize the disassembly to just our code. + 'AdditionalOptions': [ + '/NODEFAULTLIB', + ], + }, + }, + 'sources': [ + # Explicitly sorted the same way as the disassembly in the test .py. + 'main-crt.c', + 'hello.cc', + 'b/y.cc', + 'a/z.cc', + ], + }, + + + { + 'target_name': 'test_ordering_subdirs_mixed', + 'type': 'executable', + # These are so the names of the functions appear in the disassembly. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'Optimization': '2', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + 'GenerateManifest': 'false', + # Minimize the disassembly to just our code. + 'AdditionalOptions': [ + '/NODEFAULTLIB', + ], + }, + }, + 'sources': [ + # Explicitly sorted the same way as the disassembly in the test .py. + 'main-crt.c', + 'a/x.cc', + 'hello.cc', + 'a/z.cc', + 'y.cc', + ], + }, + + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/link-warning.cc b/third_party/python/gyp/test/win/linker-flags/link-warning.cc new file mode 100644 index 0000000000..4b34277ba3 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/link-warning.cc @@ -0,0 +1,10 @@ +// Copyright (c) 2013 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. + +// This will cause LNK4254. +#pragma comment(linker, "/merge:.data=.text") + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/ltcg.gyp b/third_party/python/gyp/test/win/linker-flags/ltcg.gyp new file mode 100644 index 0000000000..ddb0d9b4e2 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/ltcg.gyp @@ -0,0 +1,42 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_ltcg_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'false', + }, + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '0', + }, + }, + 'sources': [ + 'inline_test.h', + 'inline_test.cc', + 'inline_test_main.cc', + ], + }, + { + 'target_name': 'test_ltcg_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true', # /GL + }, + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '1', # /LTCG + }, + }, + 'sources': [ + 'inline_test.h', + 'inline_test.cc', + 'inline_test_main.cc', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/main-crt.c b/third_party/python/gyp/test/win/linker-flags/main-crt.c new file mode 100644 index 0000000000..bdc80c54fd --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/main-crt.c @@ -0,0 +1,8 @@ +// Copyright (c) 2013 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. + +// Stub so we can link with /NODEFAULTLIB when checking disasm. +int mainCRTStartup() { + return 5; +} diff --git a/third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc b/third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc new file mode 100644 index 0000000000..ae54ae5462 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/manifest-in-comment.cc @@ -0,0 +1,13 @@ +// Copyright 2013 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. + +#pragma comment(linker, \ + "\"/manifestdependency:type='Win32' " \ + "name='Test.Research.SampleAssembly' version='6.0.0.0' " \ + "processorArchitecture='X86' " \ + "publicKeyToken='0000000000000000' language='*'\"") + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/mapfile.cc b/third_party/python/gyp/test/win/linker-flags/mapfile.cc new file mode 100644 index 0000000000..cebccb264a --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/mapfile.cc @@ -0,0 +1,12 @@ +// Copyright (c) 2013 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. + +__declspec(dllexport) +void AnExportedFunction() { + // We need an exported function to verify that /MAPINFO:EXPORTS works. +} + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/mapfile.gyp b/third_party/python/gyp/test/win/linker-flags/mapfile.gyp new file mode 100644 index 0000000000..14206fe28d --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/mapfile.gyp @@ -0,0 +1,45 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_mapfile_unset', + 'type': 'executable', + 'sources': ['mapfile.cc'], + }, + { + 'target_name': 'test_mapfile_generate', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateMapFile': 'true', + }, + }, + 'sources': ['mapfile.cc'], + }, + { + 'target_name': 'test_mapfile_generate_exports', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateMapFile': 'true', + 'MapExports': 'true', + }, + }, + 'sources': ['mapfile.cc'], + }, + { + 'target_name': 'test_mapfile_generate_filename', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateMapFile': 'true', + 'MapFileName': '<(PRODUCT_DIR)/custom_file_name.map', + }, + }, + 'sources': ['mapfile.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/no-default-libs.cc b/third_party/python/gyp/test/win/linker-flags/no-default-libs.cc new file mode 100644 index 0000000000..e306846987 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/no-default-libs.cc @@ -0,0 +1,18 @@ +// 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. + +// Reference something in kernel32.dll. This will fail to link, verifying that +// GYP provides no default import library configuration. +// Note that we don't include Windows.h, as that will result in generating +// linker directives in the object file through #pragma comment(lib, ...). +typedef short BOOL; + +extern "C" __declspec(dllimport) +BOOL CopyFileW(const wchar_t*, const wchar_t*, BOOL); + + +int main() { + CopyFileW(0, 0, 0); // kernel32 + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp b/third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp new file mode 100644 index 0000000000..77838ce8c4 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/no-default-libs.gyp @@ -0,0 +1,13 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_default', + 'type': 'executable', + 'sources': ['no-default-libs.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc new file mode 100644 index 0000000000..24b6eca438 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.cc @@ -0,0 +1,13 @@ +// 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. + +// Include entry point function that's excluded by removing C runtime libraries. +extern "C" void mainCRTStartup() { +} + +// Still needed because the linker checks for existence of one of main, wmain, +// WinMain, or wMain to offer informative diagnositics. +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp new file mode 100644 index 0000000000..4fb452a18b --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/nodefaultlib.gyp @@ -0,0 +1,30 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'IgnoreDefaultLibraryNames': + ['libcmtd.lib', 'libcmt.lib', 'msvcrt.lib', 'msvcrtd.lib'], + } + }, + 'sources': ['nodefaultlib.cc'], + }, + { + 'target_name': 'test_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'IgnoreDefaultLibraryNames': + ['libcmtd.lib', 'libcmt.lib', 'msvcrt.lib', 'msvcrtd.lib'], + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/nxcompat.gyp b/third_party/python/gyp/test/win/linker-flags/nxcompat.gyp new file mode 100644 index 0000000000..fa4118cbd7 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/nxcompat.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_nxcompat_default', + 'type': 'executable', + 'msvs_settings': { + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_nxcompat_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'DataExecutionPrevention': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_nxcompat_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'DataExecutionPrevention': '2', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/opt-icf.cc b/third_party/python/gyp/test/win/linker-flags/opt-icf.cc new file mode 100644 index 0000000000..1f12156b7f --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/opt-icf.cc @@ -0,0 +1,29 @@ +// 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. + +void similar_function0(char* x) { + while (*x) { + ++x; + } +} + +void similar_function1(char* p) { + while (*p) { + ++p; + } +} + +void similar_function2(char* q) { + while (*q) { + ++q; + } +} + +int main() { + char* x = "hello"; + similar_function0(x); + similar_function1(x); + similar_function2(x); + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/opt-icf.gyp b/third_party/python/gyp/test/win/linker-flags/opt-icf.gyp new file mode 100644 index 0000000000..effe8021c3 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/opt-icf.gyp @@ -0,0 +1,63 @@ +# 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. + +{ + 'targets': [ + # Have to turn on function level linking here to get the function packaged + # as a COMDAT so that it's eligible for merging. Also turn on debug + # information so that the symbol names for the code appear in the dump. + # Finally, specify non-incremental linking so that there's not a bunch of + # extra "similar_function"s in the output (the ILT jump table). + { + 'target_name': 'test_opticf_default', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + 'Optimization': '0', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + }, + }, + 'sources': ['opt-icf.cc'], + }, + { + 'target_name': 'test_opticf_no', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + 'Optimization': '0', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'EnableCOMDATFolding': '1', + 'LinkIncremental': '1', + }, + }, + 'sources': ['opt-icf.cc'], + }, + { + 'target_name': 'test_opticf_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + 'Optimization': '0', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'EnableCOMDATFolding': '2', + 'LinkIncremental': '1', + }, + }, + 'sources': ['opt-icf.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/opt-ref.cc b/third_party/python/gyp/test/win/linker-flags/opt-ref.cc new file mode 100644 index 0000000000..afaa328a5d --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/opt-ref.cc @@ -0,0 +1,11 @@ +// 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. + +int unused_function() { + return 0; +} + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/opt-ref.gyp b/third_party/python/gyp/test/win/linker-flags/opt-ref.gyp new file mode 100644 index 0000000000..69d0281a08 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/opt-ref.gyp @@ -0,0 +1,56 @@ +# 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. + +{ + 'targets': [ + # Have to turn on function level linking here to get the function packaged + # as a COMDAT so that it's eligible for optimizing away. Also turn on + # debug information so that the symbol names for the code appear in the + # dump (so we can verify if they are included in the final exe). + { + 'target_name': 'test_optref_default', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['opt-ref.cc'], + }, + { + 'target_name': 'test_optref_no', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'OptimizeReferences': '1', + }, + }, + 'sources': ['opt-ref.cc'], + }, + { + 'target_name': 'test_optref_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'OptimizeReferences': '2', + }, + }, + 'sources': ['opt-ref.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/outputfile.gyp b/third_party/python/gyp/test/win/linker-flags/outputfile.gyp new file mode 100644 index 0000000000..1022ec2e20 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/outputfile.gyp @@ -0,0 +1,58 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_output_exe', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\blorp.exe' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_exe2', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\subdir\\blorp.exe' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\blorp.dll' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_lib', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(OutDir)\\blorp.lib' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_lib2', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(OutDir)\\subdir\\blorp.lib' + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/pdb-output.gyp b/third_party/python/gyp/test/win/linker-flags/pdb-output.gyp new file mode 100644 index 0000000000..1a03c67cc0 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/pdb-output.gyp @@ -0,0 +1,49 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'test_pdb_output_exe', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': 'output_exe.pdb', + }, + }, + }, + { + 'target_name': 'test_pdb_output_dll', + 'type': 'shared_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': 'output_dll.pdb', + }, + }, + }, + { + 'target_name': 'test_pdb_output_disabled', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '0' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'false', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/pgo.gyp b/third_party/python/gyp/test/win/linker-flags/pgo.gyp new file mode 100644 index 0000000000..da32639973 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/pgo.gyp @@ -0,0 +1,143 @@ +# Copyright (c) 2013 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. + +{ + 'variables': { + 'pgd_basename': 'test_pgo', + }, + 'targets': [ + # In the PGO (Profile-Guided Optimization) build flow, we need to build the + # target binary multiple times. To implement this flow with gyp, here we + # define multiple 'executable' targets, each of which represents one build + # particular build/profile stage. On tricky part to do this is that these + # 'executable' targets should share the code itself so that profile data + # can be reused among these 'executable' files. In other words, the only + # differences among below 'executable' targets are: + # 1) PGO (Profile-Guided Optimization) database, and + # 2) linker options. + # The following static library contains all the logic including entry point. + # Basically we don't need to rebuild this target once we enter profiling + # phase of PGO. + { + 'target_name': 'test_pgo_main', + 'type': 'static_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true', # /GL + }, + 'VCLibrarianTool': { + 'LinkTimeCodeGeneration': 'true', + }, + }, + 'link_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'ProfileGuidedDatabase': '$(OutDir)\\<(pgd_basename).pgd', + 'TargetMachine': '1', # x86 - 32 + 'SubSystem': '1', # /SUBSYSTEM:CONSOLE + # Tell ninja generator not to pass /ManifestFile: option + # to the linker, because it causes LNK1268 error in PGO biuld. + 'GenerateManifest': 'false', + # We need to specify 'libcmt.lib' here so that the linker can pick + # up a valid entry point. + 'AdditionalDependencies': [ + 'libcmt.lib', + ], + }, + }, + }, + 'sources': [ + 'inline_test.h', + 'inline_test.cc', + 'inline_test_main.cc', + ], + }, + { + 'target_name': 'test_pgo_instrument', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '2', + }, + }, + 'dependencies': [ + 'test_pgo_main', + ], + }, + { + 'target_name': 'gen_profile_guided_database', + 'type': 'none', + 'msvs_cygwin_shell': 0, + 'actions': [ + { + 'action_name': 'action_main', + 'inputs': [], + 'outputs': [ + '$(OutDir)\\<(pgd_basename).pgd', + ], + 'action': [ + 'python', 'update_pgd.py', + '--vcbindir', '$(VCInstallDir)bin', + '--exe', '$(OutDir)\\test_pgo_instrument.exe', + '--pgd', '$(OutDir)\\<(pgd_basename).pgd', + ], + }, + ], + 'dependencies': [ + 'test_pgo_instrument', + ], + }, + { + 'target_name': 'test_pgo_optimize', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '3', + }, + }, + 'sources': [ + '$(OutDir)\\<(pgd_basename).pgd', + ], + 'dependencies': [ + 'test_pgo_main', + 'gen_profile_guided_database', + ], + }, + { + 'target_name': 'test_pgo_update', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '4', + }, + }, + 'sources': [ + '$(OutDir)\\<(pgd_basename).pgd', + ], + 'dependencies': [ + 'test_pgo_main', + ], + }, + # A helper target to dump link.exe's command line options. We can use the + # output to determine if PGO (Profile-Guided Optimization) is available on + # the test environment. + { + 'target_name': 'gen_linker_option', + 'type': 'none', + 'msvs_cygwin_shell': 0, + 'actions': [ + { + 'action_name': 'action_main', + 'inputs': [], + 'outputs': [ + '$(OutDir)\\linker_options.txt', + ], + 'action': [ + 'cmd.exe', '/c link.exe > $(OutDir)\\linker_options.txt & exit 0', + ], + }, + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/profile.gyp b/third_party/python/gyp/test/win/linker-flags/profile.gyp new file mode 100644 index 0000000000..d60a700fbb --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/profile.gyp @@ -0,0 +1,50 @@ +# 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. + +{ + 'targets': [ + # Verify that 'Profile' option correctly makes it to LINK steup in Ninja + { + 'target_name': 'test_profile_true', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'Profile': 'true', + 'GenerateDebugInformation': 'true', + }, + }, + }, + { + 'target_name': 'test_profile_false', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'Profile': 'false', + 'GenerateDebugInformation': 'true', + }, + }, + }, + { + 'target_name': 'test_profile_default', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/program-database.gyp b/third_party/python/gyp/test/win/linker-flags/program-database.gyp new file mode 100644 index 0000000000..6e60ac0dc9 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/program-database.gyp @@ -0,0 +1,40 @@ +# 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. + +{ + 'targets': [ + # Verify that 'ProgramDatabaseFile' option correctly makes it to LINK + # step in Ninja. + { + # Verify that VC macros and windows paths work correctly. + 'target_name': 'test_pdb_outdir', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '$(OutDir)\\name_outdir.pdb', + }, + }, + }, + { + # Verify that GYP macros and POSIX paths work correctly. + 'target_name': 'test_pdb_proddir', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/name_proddir.pdb', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh.gyp b/third_party/python/gyp/test/win/linker-flags/safeseh.gyp new file mode 100644 index 0000000000..d4a62074b8 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/safeseh.gyp @@ -0,0 +1,79 @@ +# Copyright (c) 2014 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. + +{ + 'target_defaults': { + 'configurations': { + 'Default': { + 'msvs_configuration_platform': 'Win32', + }, + 'Default_x64': { + 'inherit_from': ['Default'], + 'msvs_configuration_platform': 'x64', + }, + }, + }, + 'targets': [ + { + 'target_name': 'test_safeseh_default', + 'type': 'executable', + 'msvs_settings': { + # By default, msvs passes /SAFESEH for Link, but not for MASM. In + # order for test_safeseh_default to link successfully, we need to + # explicitly specify /SAFESEH for MASM. + 'MASM': { + 'UseSafeExceptionHandlers': 'true', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero.asm', + ], + }, + { + 'target_name': 'test_safeseh_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'false', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero.asm', + ], + }, + { + 'target_name': 'test_safeseh_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'true', + }, + 'MASM': { + 'UseSafeExceptionHandlers': 'true', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero.asm', + ], + }, + { + # x64 targets cannot have ImageHasSafeExceptionHandlers or + # UseSafeExceptionHandlers set. + 'target_name': 'test_safeseh_x64', + 'type': 'executable', + 'configurations': { + 'Default': { + 'msvs_target_platform': 'x64', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero64.asm', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc b/third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc new file mode 100644 index 0000000000..6141300d2c --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/safeseh_hello.cc @@ -0,0 +1,11 @@ +// Copyright (c) 2014 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. + +extern "C" { +int zero(void); +} + +int main() { + return zero(); +} diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm b/third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm new file mode 100644 index 0000000000..62da0df4f3 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/safeseh_zero.asm @@ -0,0 +1,10 @@ +.MODEL FLAT, C +.CODE + +PUBLIC zero +zero PROC + xor eax, eax + ret 0 +zero ENDP + +END diff --git a/third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm b/third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm new file mode 100644 index 0000000000..a4740c0dfb --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/safeseh_zero64.asm @@ -0,0 +1,9 @@ +.CODE + +PUBLIC zero +zero PROC + xor eax, eax + ret 0 +zero ENDP + +END diff --git a/third_party/python/gyp/test/win/linker-flags/stacksize.gyp b/third_party/python/gyp/test/win/linker-flags/stacksize.gyp new file mode 100644 index 0000000000..bba44ca4a7 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/stacksize.gyp @@ -0,0 +1,44 @@ +# Copyright (c) 2015 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. + +{ + 'targets': [ + { + 'target_name': 'test_default', + 'type': 'executable', + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_set_reserved_size', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'StackReserveSize': 2097152, # 2MB + } + }, + }, + { + 'target_name': 'test_set_commit_size', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'StackCommitSize': 8192, # 8KB + } + }, + }, + { + 'target_name': 'test_set_both', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'StackReserveSize': 2097152, # 2MB + 'StackCommitSize': 8192, # 8KB + } + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/subdir/library.gyp b/third_party/python/gyp/test/win/linker-flags/subdir/library.gyp new file mode 100644 index 0000000000..519577f0d7 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/subdir/library.gyp @@ -0,0 +1,13 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_lib', + 'type': 'static_library', + 'sources': ['../library-directories-define.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc b/third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc new file mode 100644 index 0000000000..ac99da808e --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/subsystem-windows.cc @@ -0,0 +1,9 @@ +// 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. + +#include + +int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { + return 0; +} diff --git a/third_party/python/gyp/test/win/linker-flags/subsystem.gyp b/third_party/python/gyp/test/win/linker-flags/subsystem.gyp new file mode 100644 index 0000000000..63f072a206 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/subsystem.gyp @@ -0,0 +1,70 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_console_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_console_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '1' + } + }, + 'sources': ['subsystem-windows.cc'], + }, + { + 'target_name': 'test_windows_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2' + } + }, + 'sources': ['subsystem-windows.cc'], + }, + { + 'target_name': 'test_windows_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_console_xp', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '1', + 'MinimumRequiredVersion': '5.01', # XP. + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_windows_xp', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2', + 'MinimumRequiredVersion': '5.01', # XP. + } + }, + 'sources': ['subsystem-windows.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/target-machine.gyp b/third_party/python/gyp/test/win/linker-flags/target-machine.gyp new file mode 100644 index 0000000000..30271926c9 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/target-machine.gyp @@ -0,0 +1,48 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_target_link_x86', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TargetMachine': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_target_link_x64', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TargetMachine': '17', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_target_lib_x86', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'TargetMachine': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_target_lib_x64', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'TargetMachine': '17', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/tsaware.gyp b/third_party/python/gyp/test/win/linker-flags/tsaware.gyp new file mode 100644 index 0000000000..7ffc7426bb --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/tsaware.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_tsaware_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TerminalServerAware': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_tsaware_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TerminalServerAware': '2', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp b/third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp new file mode 100644 index 0000000000..5549e7cb9b --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/unsupported-manifest.gyp @@ -0,0 +1,13 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_unsupported', + 'type': 'executable', + 'sources': ['manifest-in-comment.cc'], + }, + ], +} diff --git a/third_party/python/gyp/test/win/linker-flags/update_pgd.py b/third_party/python/gyp/test/win/linker-flags/update_pgd.py new file mode 100644 index 0000000000..176e9e5472 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/update_pgd.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 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. + +from optparse import OptionParser +import glob +import os +import subprocess + +parser = OptionParser() +parser.add_option('--exe', dest='exe') +parser.add_option('--vcbindir', dest='vcbindir') +parser.add_option('--pgd', dest='pgd') +(options, args) = parser.parse_args() + +# Instrumented binaries fail to run unless the Visual C++'s bin dir is included +# in the PATH environment variable. +os.environ['PATH'] = os.environ['PATH'] + os.pathsep + options.vcbindir + +# Run Instrumented binary. The profile will be recorded into *.pgc file. +subprocess.call([options.exe]) + +# Merge *.pgc files into a *.pgd (Profile-Guided Database) file. +subprocess.call(['pgomgr', '/merge', options.pgd]) + +# *.pgc files are no longer necessary. Clear all of them. +pgd_file = os.path.abspath(options.pgd) +pgd_dir = os.path.dirname(pgd_file) +(pgd_basename, _) = os.path.splitext(os.path.basename(pgd_file)) +pgc_filepattern = os.path.join(pgd_dir, '%s!*.pgc' % pgd_basename) +pgc_files= glob.glob(pgc_filepattern) +for pgc_file in pgc_files: + os.unlink(pgc_file) diff --git a/third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp b/third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp new file mode 100644 index 0000000000..83c67e9df1 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/warn-as-error.gyp @@ -0,0 +1,33 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_on', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TreatLinkerWarningAsErrors': 'true', + } + }, + 'sources': ['link-warning.cc'], + }, + { + 'target_name': 'test_off', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TreatLinkerWarningAsErrors': 'false', + } + }, + 'sources': ['link-warning.cc'], + }, + { + 'target_name': 'test_default', + 'type': 'executable', + 'sources': ['link-warning.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/linker-flags/x.cc b/third_party/python/gyp/test/win/linker-flags/x.cc new file mode 100644 index 0000000000..f5f763b095 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/x.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int x() { + return 1; +} diff --git a/third_party/python/gyp/test/win/linker-flags/y.cc b/third_party/python/gyp/test/win/linker-flags/y.cc new file mode 100644 index 0000000000..bd884119fc --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/y.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int y() { + return 2; +} diff --git a/third_party/python/gyp/test/win/linker-flags/z.cc b/third_party/python/gyp/test/win/linker-flags/z.cc new file mode 100644 index 0000000000..8a43501270 --- /dev/null +++ b/third_party/python/gyp/test/win/linker-flags/z.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int z() { + return 3; +} diff --git a/third_party/python/gyp/test/win/long-command-line/function.cc b/third_party/python/gyp/test/win/long-command-line/function.cc new file mode 100644 index 0000000000..af44b2cabd --- /dev/null +++ b/third_party/python/gyp/test/win/long-command-line/function.cc @@ -0,0 +1,7 @@ +// 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. + +int func() { + return 0; +} diff --git a/third_party/python/gyp/test/win/long-command-line/hello.cc b/third_party/python/gyp/test/win/long-command-line/hello.cc new file mode 100644 index 0000000000..1711567ef5 --- /dev/null +++ b/third_party/python/gyp/test/win/long-command-line/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/long-command-line/long-command-line.gyp b/third_party/python/gyp/test/win/long-command-line/long-command-line.gyp new file mode 100644 index 0000000000..964c94fa94 --- /dev/null +++ b/third_party/python/gyp/test/win/long-command-line/long-command-line.gyp @@ -0,0 +1,54 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'longexe', + 'type': 'executable', + 'msvs_settings': { + # Use this as a simple way to get a long command. + 'VCCLCompilerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + 'VCLinkerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + }, + 'sources': [ + 'hello.cc', + ], + }, + { + 'target_name': 'longlib', + 'type': 'static_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + 'VCLibrarianTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + }, + 'sources': [ + 'function.cc', + ], + }, + { + 'target_name': 'longdll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + 'VCLinkerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + }, + 'sources': [ + 'hello.cc', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/ml-safeseh/a.asm b/third_party/python/gyp/test/win/ml-safeseh/a.asm new file mode 100644 index 0000000000..62da0df4f3 --- /dev/null +++ b/third_party/python/gyp/test/win/ml-safeseh/a.asm @@ -0,0 +1,10 @@ +.MODEL FLAT, C +.CODE + +PUBLIC zero +zero PROC + xor eax, eax + ret 0 +zero ENDP + +END diff --git a/third_party/python/gyp/test/win/ml-safeseh/hello.cc b/third_party/python/gyp/test/win/ml-safeseh/hello.cc new file mode 100644 index 0000000000..6141300d2c --- /dev/null +++ b/third_party/python/gyp/test/win/ml-safeseh/hello.cc @@ -0,0 +1,11 @@ +// Copyright (c) 2014 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. + +extern "C" { +int zero(void); +} + +int main() { + return zero(); +} diff --git a/third_party/python/gyp/test/win/ml-safeseh/ml-safeseh.gyp b/third_party/python/gyp/test/win/ml-safeseh/ml-safeseh.gyp new file mode 100644 index 0000000000..bf8618f865 --- /dev/null +++ b/third_party/python/gyp/test/win/ml-safeseh/ml-safeseh.gyp @@ -0,0 +1,24 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'ml_safeseh', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'a.asm', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'true', + }, + 'MASM': { + 'UseSafeExceptionHandlers': 'true', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/precompiled/gyptest-all.py b/third_party/python/gyp/test/win/precompiled/gyptest-all.py new file mode 100644 index 0000000000..9fb5e62edf --- /dev/null +++ b/third_party/python/gyp/test/win/precompiled/gyptest-all.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +# Copyright (c) 2011 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. + +""" +Verifies that precompiled headers can be specified. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja'], workdir='workarea_all') + test.run_gyp('hello.gyp') + test.build('hello.gyp', 'hello') + test.run_built_executable('hello', stdout="Hello, world!\nHello, two!\n") + test.up_to_date('hello.gyp', test.ALL) + test.pass_test() diff --git a/third_party/python/gyp/test/win/precompiled/hello.c b/third_party/python/gyp/test/win/precompiled/hello.c new file mode 100644 index 0000000000..ffb47bf822 --- /dev/null +++ b/third_party/python/gyp/test/win/precompiled/hello.c @@ -0,0 +1,14 @@ +/* Copyright (c) 2011 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. */ + +// Note the abscence of a stdio.h include. This will be inserted because of the +// precompiled header. + +extern int hello2(); + +int main(void) { + printf("Hello, world!\n"); + hello2(); + return 0; +} diff --git a/third_party/python/gyp/test/win/precompiled/hello.gyp b/third_party/python/gyp/test/win/precompiled/hello.gyp new file mode 100644 index 0000000000..5f82c53593 --- /dev/null +++ b/third_party/python/gyp/test/win/precompiled/hello.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'hello', + 'type': 'executable', + 'sources': [ + 'hello.c', + 'hello2.c', + 'precomp.c', + ], + 'msvs_precompiled_header': 'stdio.h', + 'msvs_precompiled_source': 'precomp.c', + + # Required so that the printf actually causes a build failure + # if the pch isn't included. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '3', + 'WarnAsError': 'true', + }, + }, + }, + ], +} diff --git a/third_party/python/gyp/test/win/precompiled/hello2.c b/third_party/python/gyp/test/win/precompiled/hello2.c new file mode 100644 index 0000000000..d6d53111fb --- /dev/null +++ b/third_party/python/gyp/test/win/precompiled/hello2.c @@ -0,0 +1,13 @@ +/* Copyright (c) 2011 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. */ + +// Unlike hello.c, this file specifies the headers. + +#include +#include + +int hello2() { + printf("Hello, two!\n"); + return 0; +} diff --git a/third_party/python/gyp/test/win/precompiled/precomp.c b/third_party/python/gyp/test/win/precompiled/precomp.c new file mode 100644 index 0000000000..517c61a36b --- /dev/null +++ b/third_party/python/gyp/test/win/precompiled/precomp.c @@ -0,0 +1,8 @@ +/* Copyright (c) 2011 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. */ + +// The precompiled header does not have to be the first one in the file. + +#include +#include diff --git a/third_party/python/gyp/test/win/rc-build/Resource.h b/third_party/python/gyp/test/win/rc-build/Resource.h new file mode 100644 index 0000000000..137acf39b5 --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/Resource.h @@ -0,0 +1,26 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by hello.rc +// + +#define IDS_APP_TITLE 103 + +#define IDR_MAINFRAME 128 +#define IDI_HELLO 107 +#define IDI_SMALL 108 +#define IDC_HELLO 109 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/third_party/python/gyp/test/win/rc-build/hello.cpp b/third_party/python/gyp/test/win/rc-build/hello.cpp new file mode 100644 index 0000000000..f552ca1591 --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/hello.cpp @@ -0,0 +1,30 @@ +// 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. + +#define WIN32_LEAN_AND_MEAN +#include +#include + +#include "resource.h" + +#define MAX_LOADSTRING 100 + +TCHAR szTitle[MAX_LOADSTRING]; +TCHAR szWindowClass[MAX_LOADSTRING]; + +int APIENTRY _tWinMain( + HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) { + // Make sure we can load some resources. + int count = 0; + LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + if (szTitle[0] != 0) ++count; + LoadString(hInstance, IDC_HELLO, szWindowClass, MAX_LOADSTRING); + if (szWindowClass[0] != 0) ++count; + if (LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SMALL)) != NULL) ++count; + if (LoadIcon(hInstance, MAKEINTRESOURCE(IDI_HELLO)) != NULL) ++count; + return count; +} diff --git a/third_party/python/gyp/test/win/rc-build/hello.gyp b/third_party/python/gyp/test/win/rc-build/hello.gyp new file mode 100644 index 0000000000..3a66357dd4 --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/hello.gyp @@ -0,0 +1,92 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'with_resources', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + }, + }, + 'sources': [ + 'hello.cpp', + 'hello.rc', + ], + 'libraries': [ + 'kernel32.lib', + 'user32.lib', + ], + }, + { + 'target_name': 'with_resources_subdir', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + }, + }, + 'sources': [ + 'hello.cpp', + 'subdir/hello2.rc', + ], + 'libraries': [ + 'kernel32.lib', + 'user32.lib', + ], + }, + { + 'target_name': 'with_include_subdir', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + }, + }, + 'resource_include_dirs': [ + '$(ProjectDir)\\subdir', + ], + 'sources': [ + 'hello.cpp', + 'hello3.rc', + ], + 'libraries': [ + 'kernel32.lib', + 'user32.lib', + ], + }, + { + 'target_name': 'resource_only_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'ResourceOnlyDLL': 'true', + }, + }, + 'sources': [ + 'hello.rc', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/win/rc-build/hello.h b/third_party/python/gyp/test/win/rc-build/hello.h new file mode 100644 index 0000000000..e60f2eb7ed --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/hello.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/third_party/python/gyp/test/win/rc-build/hello.ico b/third_party/python/gyp/test/win/rc-build/hello.ico new file mode 100644 index 0000000000..d551aa3aaf Binary files /dev/null and b/third_party/python/gyp/test/win/rc-build/hello.ico differ diff --git a/third_party/python/gyp/test/win/rc-build/hello.rc b/third_party/python/gyp/test/win/rc-build/hello.rc new file mode 100644 index 0000000000..c9a7af6a07 --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/hello.rc @@ -0,0 +1,86 @@ +//Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(932) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +IDI_HELLO ICON "hello.ico" +IDI_SMALL ICON "small.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDC_HELLO "HELLO" + IDS_APP_TITLE "hello" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/third_party/python/gyp/test/win/rc-build/hello3.rc b/third_party/python/gyp/test/win/rc-build/hello3.rc new file mode 100644 index 0000000000..c74dede576 --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/hello3.rc @@ -0,0 +1,87 @@ +//Microsoft Visual C++ generated resource script. +// +#include "include.h" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(932) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +IDI_HELLO ICON "hello.ico" +IDI_SMALL ICON "small.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDC_HELLO "HELLO" + IDS_APP_TITLE "hello" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/third_party/python/gyp/test/win/rc-build/small.ico b/third_party/python/gyp/test/win/rc-build/small.ico new file mode 100644 index 0000000000..d551aa3aaf Binary files /dev/null and b/third_party/python/gyp/test/win/rc-build/small.ico differ diff --git a/third_party/python/gyp/test/win/rc-build/subdir/hello2.rc b/third_party/python/gyp/test/win/rc-build/subdir/hello2.rc new file mode 100644 index 0000000000..4c8eab109e --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/subdir/hello2.rc @@ -0,0 +1,87 @@ +//Microsoft Visual C++ generated resource script. +// +#include "subdir/include.h" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(932) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +IDI_HELLO ICON "hello.ico" +IDI_SMALL ICON "small.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDC_HELLO "HELLO" + IDS_APP_TITLE "hello" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/third_party/python/gyp/test/win/rc-build/subdir/include.h b/third_party/python/gyp/test/win/rc-build/subdir/include.h new file mode 100644 index 0000000000..f15c48b422 --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/subdir/include.h @@ -0,0 +1 @@ +// Just exists to make sure it can be included. diff --git a/third_party/python/gyp/test/win/rc-build/targetver.h b/third_party/python/gyp/test/win/rc-build/targetver.h new file mode 100644 index 0000000000..f583181dfd --- /dev/null +++ b/third_party/python/gyp/test/win/rc-build/targetver.h @@ -0,0 +1,24 @@ +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif diff --git a/third_party/python/gyp/test/win/shard/hello.cc b/third_party/python/gyp/test/win/shard/hello.cc new file mode 100644 index 0000000000..a9dce62453 --- /dev/null +++ b/third_party/python/gyp/test/win/shard/hello.cc @@ -0,0 +1,7 @@ +// Copyright 2014 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/shard/hello1.cc b/third_party/python/gyp/test/win/shard/hello1.cc new file mode 100644 index 0000000000..0eccf2861d --- /dev/null +++ b/third_party/python/gyp/test/win/shard/hello1.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int f1() { + return 0; +} diff --git a/third_party/python/gyp/test/win/shard/hello2.cc b/third_party/python/gyp/test/win/shard/hello2.cc new file mode 100644 index 0000000000..23fcb546cb --- /dev/null +++ b/third_party/python/gyp/test/win/shard/hello2.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int f2() { + return 0; +} diff --git a/third_party/python/gyp/test/win/shard/hello3.cc b/third_party/python/gyp/test/win/shard/hello3.cc new file mode 100644 index 0000000000..a72e2efb5a --- /dev/null +++ b/third_party/python/gyp/test/win/shard/hello3.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int f3() { + return 0; +} diff --git a/third_party/python/gyp/test/win/shard/hello4.cc b/third_party/python/gyp/test/win/shard/hello4.cc new file mode 100644 index 0000000000..a94df19499 --- /dev/null +++ b/third_party/python/gyp/test/win/shard/hello4.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2013 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. + +int f4() { + return 0; +} diff --git a/third_party/python/gyp/test/win/shard/shard.gyp b/third_party/python/gyp/test/win/shard/shard.gyp new file mode 100644 index 0000000000..eac45fcff7 --- /dev/null +++ b/third_party/python/gyp/test/win/shard/shard.gyp @@ -0,0 +1,31 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'shard', + 'type': 'static_library', + 'msvs_shard': 4, + 'sources': [ + 'hello1.cc', + 'hello2.cc', + 'hello3.cc', + 'hello4.cc', + ], + 'product_dir': '<(PRODUCT_DIR)', + }, + { + 'target_name': 'refs_to_shard', + 'type': 'executable', + 'dependencies': [ + # Make sure references are correctly updated. + 'shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/shard/shard_ref.gyp b/third_party/python/gyp/test/win/shard/shard_ref.gyp new file mode 100644 index 0000000000..3ec8d76f99 --- /dev/null +++ b/third_party/python/gyp/test/win/shard/shard_ref.gyp @@ -0,0 +1,41 @@ +# Copyright 2014 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. + +{ + 'targets': [ + { + 'target_name': 'refs_to_shard_external_lib', + 'type': 'static_library', + 'dependencies': [ + # Make sure references in other files are updated correctly. + 'shard.gyp:shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + { + 'target_name': 'refs_to_shard_external_exe', + 'type': 'executable', + 'dependencies': [ + # Make sure references in other files are updated correctly. + 'shard.gyp:shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + { + 'target_name': 'refs_to_shard_external_dll', + 'type': 'shared_library', + 'dependencies': [ + # Make sure references in other files are updated correctly. + 'shard.gyp:shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/system-include/bar/header.h b/third_party/python/gyp/test/win/system-include/bar/header.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/system-include/common/commonheader.h b/third_party/python/gyp/test/win/system-include/common/commonheader.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/system-include/foo/header.h b/third_party/python/gyp/test/win/system-include/foo/header.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/system-include/main.cc b/third_party/python/gyp/test/win/system-include/main.cc new file mode 100644 index 0000000000..b04ea8a530 --- /dev/null +++ b/third_party/python/gyp/test/win/system-include/main.cc @@ -0,0 +1,4 @@ +#include +#include + +int main() {} diff --git a/third_party/python/gyp/test/win/system-include/test.gyp b/third_party/python/gyp/test/win/system-include/test.gyp new file mode 100644 index 0000000000..07f2636543 --- /dev/null +++ b/third_party/python/gyp/test/win/system-include/test.gyp @@ -0,0 +1,26 @@ +{ + 'target_defaults': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + }, + }, + 'msvs_system_include_dirs': [ + '$(ProjectName)', # Different for each target + 'common', # Same for all targets + ], + }, + 'targets': [ + { + 'target_name': 'foo', + 'type': 'executable', + 'sources': [ 'main.cc', ], + }, + { + 'target_name': 'bar', + 'type': 'executable', + 'sources': [ 'main.cc', ], + }, + ], +} diff --git a/third_party/python/gyp/test/win/uldi/a.cc b/third_party/python/gyp/test/win/uldi/a.cc new file mode 100644 index 0000000000..0fe05d5afb --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/a.cc @@ -0,0 +1,7 @@ +// 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. + +int some_function() { + return 0; +} diff --git a/third_party/python/gyp/test/win/uldi/b.cc b/third_party/python/gyp/test/win/uldi/b.cc new file mode 100644 index 0000000000..0fe05d5afb --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/b.cc @@ -0,0 +1,7 @@ +// 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. + +int some_function() { + return 0; +} diff --git a/third_party/python/gyp/test/win/uldi/dll.cc b/third_party/python/gyp/test/win/uldi/dll.cc new file mode 100644 index 0000000000..93a6c19003 --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/dll.cc @@ -0,0 +1,6 @@ +// Copyright (c) 2015 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. + +__declspec(dllexport) void SomeFunction() { +} diff --git a/third_party/python/gyp/test/win/uldi/exe.cc b/third_party/python/gyp/test/win/uldi/exe.cc new file mode 100644 index 0000000000..b3039ace96 --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/exe.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2015 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/uldi/main.cc b/third_party/python/gyp/test/win/uldi/main.cc new file mode 100644 index 0000000000..81b46d863a --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/main.cc @@ -0,0 +1,10 @@ +// 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. + +extern int some_function(); + +int main() { + some_function(); + return 0; +} diff --git a/third_party/python/gyp/test/win/uldi/uldi-depending-on-module.gyp b/third_party/python/gyp/test/win/uldi/uldi-depending-on-module.gyp new file mode 100644 index 0000000000..3e34de8418 --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/uldi-depending-on-module.gyp @@ -0,0 +1,42 @@ +# Copyright (c) 2015 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. + +{ + 'targets': [ + { + 'target_name': 'an_exe', + 'type': 'executable', + 'sources': ['exe.cc'], + 'dependencies': [ + 'a_dll', + ], + }, + { + 'target_name': 'a_dll', + 'type': 'shared_library', + 'sources': ['dll.cc'], + 'dependencies': [ + 'a_lib', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'UseLibraryDependencyInputs': 'true' + }, + }, + }, + { + 'target_name': 'a_lib', + 'type': 'static_library', + 'dependencies': [ + 'a_module', + ], + 'sources': ['a.cc'], + }, + { + 'target_name': 'a_module', + 'type': 'loadable_module', + 'sources': ['a.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/uldi/uldi.gyp b/third_party/python/gyp/test/win/uldi/uldi.gyp new file mode 100644 index 0000000000..c32f5e0956 --- /dev/null +++ b/third_party/python/gyp/test/win/uldi/uldi.gyp @@ -0,0 +1,45 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'lib1', + 'type': 'static_library', + 'sources': ['a.cc'], + }, + { + 'target_name': 'final_uldi', + 'type': 'executable', + 'dependencies': [ + 'lib1', + 'lib2', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'UseLibraryDependencyInputs': 'true' + }, + }, + 'sources': ['main.cc'], + }, + { + 'target_name': 'final_no_uldi', + 'type': 'executable', + 'dependencies': [ + 'lib1', + 'lib2', + ], + 'sources': ['main.cc'], + }, + { + 'target_name': 'lib2', + 'type': 'static_library', + # b.cc has the same named function as a.cc, but don't use the same name + # so that the .obj will have a different name. If the obj file has the + # same name, the linker will discard the obj file, invalidating the + # test. + 'sources': ['b.cc'], + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/as.py b/third_party/python/gyp/test/win/vs-macros/as.py new file mode 100644 index 0000000000..806c91d926 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/as.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +# 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. + +from __future__ import print_function + +from optparse import OptionParser + +parser = OptionParser() +parser.add_option('-a', dest='platform') +parser.add_option('-o', dest='output') +parser.add_option('-p', dest='path') +(options, args) = parser.parse_args() + +f = open(options.output, 'w') +print('options', options, file=f) +print('args', args, file=f) +f.close() diff --git a/third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp b/third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp new file mode 100644 index 0000000000..c07b639ff1 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/containing-gyp.gyp @@ -0,0 +1,39 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_expansions', + 'msvs_cygwin_shell': 0, + 'type': 'none', + 'rules': [ + { + 'rule_name': 'assembler (gnu-compatible)', + 'msvs_cygwin_shell': 0, + 'msvs_quote_cmd': 0, + 'extension': 'S', + 'inputs': [ + 'as.py', + ], + 'outputs': [ + '$(IntDir)/$(InputName).obj', + ], + 'action': + ['python', + 'as.py', + '-a', '$(PlatformName)', + '-o', '$(IntDir)/$(InputName).obj', + '-p', '<(DEPTH)', + '$(InputPath)'], + 'message': 'Building assembly language file $(InputPath)', + 'process_outputs_as_sources': 1, + }, + ], + 'sources': [ + 'input.S', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/do_stuff.py b/third_party/python/gyp/test/win/vs-macros/do_stuff.py new file mode 100644 index 0000000000..4669d3139b --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/do_stuff.py @@ -0,0 +1,8 @@ +# 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. + +import sys + +input = open(sys.argv[1], "r").read() +open(sys.argv[2], "w").write(input + "Modified.") diff --git a/third_party/python/gyp/test/win/vs-macros/hello.cc b/third_party/python/gyp/test/win/vs-macros/hello.cc new file mode 100644 index 0000000000..1711567ef5 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp b/third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp new file mode 100644 index 0000000000..b4520f8cb8 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/input-output-macros.gyp @@ -0,0 +1,32 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_expansions', + 'msvs_cygwin_shell': 0, + 'type': 'none', + 'rules': [ + { + 'rule_name': 'generate_file', + 'extension': 'blah', + 'inputs': [ + 'do_stuff.py', + ], + 'outputs': [ + '$(OutDir)\\<(RULE_INPUT_NAME).something', + ], + 'action': ['python', + 'do_stuff.py', + '<(RULE_INPUT_PATH)', + '$(OutDir)\\<(RULE_INPUT_NAME).something',], + }, + ], + 'sources': [ + 'stuff.blah', + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/input.S b/third_party/python/gyp/test/win/vs-macros/input.S new file mode 100644 index 0000000000..e69de29bb2 diff --git a/third_party/python/gyp/test/win/vs-macros/projectname.gyp b/third_party/python/gyp/test/win/vs-macros/projectname.gyp new file mode 100644 index 0000000000..625a177643 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/projectname.gyp @@ -0,0 +1,29 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_expansions', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\$(ProjectName)_plus_something.exe', + }, + }, + }, + { + 'target_name': 'test_with_product_name', + 'product_name': 'prod_name', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\$(ProjectName)_plus_something.exe', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/stuff.blah b/third_party/python/gyp/test/win/vs-macros/stuff.blah new file mode 100644 index 0000000000..d438b4a787 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/stuff.blah @@ -0,0 +1 @@ +Random data file. diff --git a/third_party/python/gyp/test/win/vs-macros/targetext.gyp b/third_party/python/gyp/test/win/vs-macros/targetext.gyp new file mode 100644 index 0000000000..11f580e4a6 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/targetext.gyp @@ -0,0 +1,59 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'test_targetext_executable', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\executable$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_loadable_module', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\loadable_module$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_shared_library', + 'type': 'shared_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\shared_library$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_static_library', + 'type': 'static_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(TargetDir)\\static_library$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_product_extension', + 'type': 'executable', + 'sources': ['hello.cc'], + 'product_extension': 'library', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\product_extension$(TargetExt)', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/targetfilename.gyp b/third_party/python/gyp/test/win/vs-macros/targetfilename.gyp new file mode 100644 index 0000000000..8287320278 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/targetfilename.gyp @@ -0,0 +1,59 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'test_targetfilename_executable', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_loadable_module', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_shared_library', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_static_library', + 'type': 'static_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_product_extension', + 'type': 'executable', + 'sources': ['hello.cc'], + 'product_extension': 'foo', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/targetname.gyp b/third_party/python/gyp/test/win/vs-macros/targetname.gyp new file mode 100644 index 0000000000..a53d3c0aa3 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/targetname.gyp @@ -0,0 +1,52 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'test_targetname', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something1.exe', + }, + }, + }, + { + 'target_name': 'test_targetname_with_prefix', + 'product_prefix': 'prod_prefix', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something2.exe', + }, + }, + }, + { + 'target_name': 'test_targetname_with_prodname', + 'product_name': 'prod_name', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something3.exe', + }, + }, + }, + { + 'target_name': 'test_targetname_with_prodname_with_prefix', + 'product_name': 'prod_name', + 'product_prefix': 'prod_prefix', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something4.exe', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/targetpath.gyp b/third_party/python/gyp/test/win/vs-macros/targetpath.gyp new file mode 100644 index 0000000000..a8699ffb25 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/targetpath.gyp @@ -0,0 +1,59 @@ +# Copyright (c) 2014 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. + +{ + 'targets': [ + { + 'target_name': 'test_targetpath_executable', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_loadable_module', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_shared_library', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_static_library', + 'type': 'static_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_product_extension', + 'type': 'executable', + 'sources': ['hello.cc'], + 'product_extension': 'foo', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/vs-macros/test_exists.py b/third_party/python/gyp/test/win/vs-macros/test_exists.py new file mode 100644 index 0000000000..297b1b7d9f --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/test_exists.py @@ -0,0 +1,10 @@ +# 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. + +import os +import sys + +if not os.path.exists(sys.argv[1]): + raise Exception() +open(sys.argv[2], 'w').close() diff --git a/third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp b/third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp new file mode 100644 index 0000000000..3763a4eb18 --- /dev/null +++ b/third_party/python/gyp/test/win/vs-macros/vcinstalldir.gyp @@ -0,0 +1,41 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_slash_trailing', + 'type': 'none', + 'msvs_cygwin_shell': '0', + 'actions': [ + { + 'action_name': 'root', + 'inputs': [], + 'outputs': ['out1'], + 'action': ['python', 'test_exists.py', '$(VCInstallDir)', 'out1'] + }, + ], + }, + { + 'target_name': 'test_slash_dir', + 'type': 'none', + 'msvs_cygwin_shell': '0', + 'actions': [ + { + 'action_name': 'bin', + 'inputs': [], + 'outputs': ['out2'], + 'action': ['python', 'test_exists.py', '$(VCInstallDir)bin', 'out2'], + }, + { + 'action_name': 'compiler', + 'inputs': [], + 'outputs': ['out3'], + 'action': [ + 'python', 'test_exists.py', '$(VCInstallDir)bin\\cl.exe', 'out3'], + }, + ], + }, + ] +} diff --git a/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.c b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.c new file mode 100644 index 0000000000..a6bee029ab --- /dev/null +++ b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.c @@ -0,0 +1,10 @@ +// Copyright (c) 2016 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. + +#include "win-driver-target-type.h" + +NTSTATUS DriverEntry(_In_ struct _DRIVER_OBJECT *DriverObject, + _In_ PUNICODE_STRING RegistryPath) { + return STATUS_SUCCESS; +} diff --git a/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp new file mode 100644 index 0000000000..5da9cc9bd8 --- /dev/null +++ b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp @@ -0,0 +1,32 @@ +# Copyright (c) 2016 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. + +{ + 'targets': [ + { + 'target_name': 'win_driver_target_type', + 'type': 'windows_driver', + 'msvs_target_version': 'Windows7', + 'sources': [ + 'win-driver-target-type.c', + 'win-driver-target-type.h', + 'win-driver-target-type.rc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wdmsec.lib', + 'ntoskrnl.lib', + 'hal.lib', + 'wmilib.lib', + 'bufferoverflowfastfailk.lib', + ], + }, + 'VCCLCompilerTool': { + 'WarnAsError': 'false', + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.h b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.h new file mode 100644 index 0000000000..5bbffd2373 --- /dev/null +++ b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.h @@ -0,0 +1,13 @@ +// Copyright (c) 2016 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE + +#ifndef _WIN_DRIVER_TARGET_TYPE_H_ +#define _WIN_DRIVER_TARGET_TYPE_H_ + +#include +#include + +DRIVER_INITIALIZE DriverEntry; + +#endif diff --git a/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.rc b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.rc new file mode 100644 index 0000000000..7a037ef736 --- /dev/null +++ b/third_party/python/gyp/test/win/win-driver-target-type/win-driver-target-type.rc @@ -0,0 +1,14 @@ +// Copyright (c) 2016 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. + +#include +#include + +#define VER_FILETYPE VFT_DRV +#define VER_FILESUBTYPE VFT2_DRV_SYSTEM +#define VER_FILEDESCRIPTION_STR "Windows Driver GYP target type" +#define VER_INTERNALNAME_STR "win-driver-target-type.sys" +#define VER_ORIGINALFILENAME_STR "win-driver-target-type.sys" + +#include "common.ver" diff --git a/third_party/python/gyp/test/win/win-tool/copies_readonly_files.gyp b/third_party/python/gyp/test/win/win-tool/copies_readonly_files.gyp new file mode 100644 index 0000000000..3cd7e69f1a --- /dev/null +++ b/third_party/python/gyp/test/win/win-tool/copies_readonly_files.gyp @@ -0,0 +1,29 @@ +{ + 'targets': [ + { + 'target_name': 'foo', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/dest', + 'files': [ + 'read-only-file', + ], + }, + ], + }, # target: foo + + { + 'target_name': 'bar', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/dest', + 'files': [ + 'subdir/', + ], + }, + ], + }, # target: bar + ], +} diff --git a/third_party/python/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py b/third_party/python/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py new file mode 100644 index 0000000000..951b952775 --- /dev/null +++ b/third_party/python/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +# Copyright (c) 2014 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. + +""" +Make sure overwriting read-only files works as expected (via win-tool). +""" + +import TestGyp + +import filecmp +import os +import stat +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + # First, create the source files. + os.makedirs('subdir') + read_only_files = ['read-only-file', 'subdir/A', 'subdir/B', 'subdir/C'] + for f in read_only_files: + test.write(f, 'source_contents') + test.chmod(f, stat.S_IREAD) + if os.access(f, os.W_OK): + test.fail_test() + + # Second, create the read-only destination files. Note that we are creating + # them where the ninja and win-tool will try to copy them to, in order to test + # that copies overwrite the files. + os.makedirs(test.built_file_path('dest/subdir')) + for f in read_only_files: + f = os.path.join('dest', f) + test.write(test.built_file_path(f), 'SHOULD BE OVERWRITTEN') + test.chmod(test.built_file_path(f), stat.S_IREAD) + # Ensure not writable. + if os.access(test.built_file_path(f), os.W_OK): + test.fail_test() + + test.run_gyp('copies_readonly_files.gyp') + test.build('copies_readonly_files.gyp') + + # Check the destination files were overwritten by ninja. + for f in read_only_files: + f = os.path.join('dest', f) + test.must_contain(test.built_file_path(f), 'source_contents') + + # This will fail if the files are not the same mode or contents. + for f in read_only_files: + if not filecmp.cmp(f, test.built_file_path(os.path.join('dest', f))): + test.fail_test() + + test.pass_test() diff --git a/third_party/python/gyp/test/win/winrt-app-type-revision/dllmain.cc b/third_party/python/gyp/test/win/winrt-app-type-revision/dllmain.cc new file mode 100644 index 0000000000..dedd83c3f6 --- /dev/null +++ b/third_party/python/gyp/test/win/winrt-app-type-revision/dllmain.cc @@ -0,0 +1,30 @@ +// Copyright (c) 2013 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. + +#include +#include +#include +#include + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr dp; + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); + if (SUCCEEDED(hr)) { + float dpi = 96.0f; + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) { + return true; + } + } + return false; +} + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/third_party/python/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp b/third_party/python/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp new file mode 100644 index 0000000000..5f37b5a2ab --- /dev/null +++ b/third_party/python/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp @@ -0,0 +1,43 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'enable_winrt_81_revision_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '8.1' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_82_revision_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '8.2' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_invalid_revision_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '999' + 'sources': [ + 'dllmain.cc', + ], + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + '%(AdditionalDependencies)', + ], + }, + }, + }, + ] +} diff --git a/third_party/python/gyp/test/win/winrt-target-platform-version/dllmain.cc b/third_party/python/gyp/test/win/winrt-target-platform-version/dllmain.cc new file mode 100644 index 0000000000..d71460c924 --- /dev/null +++ b/third_party/python/gyp/test/win/winrt-target-platform-version/dllmain.cc @@ -0,0 +1,30 @@ +// Copyright (c) 2015 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. + +#include +#include +#include +#include + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr dp; + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); + if (SUCCEEDED(hr)) { + float dpi = 96.0f; + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) { + return true; + } + } + return false; +} + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/third_party/python/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp b/third_party/python/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp new file mode 100644 index 0000000000..dbcfac6962 --- /dev/null +++ b/third_party/python/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp @@ -0,0 +1,49 @@ +# Copyright (c) 2015 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. + +{ + 'targets': [ + { + 'target_name': 'enable_winrt_10_platversion_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'msvs_target_platform_version':'10.0.10240.0', + 'msvs_target_platform_minversion':'10.0.10240.0' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_10_platversion_nominver_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'msvs_target_platform_version':'10.0.10240.0', + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_9_platversion_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'msvs_target_platform_version':'9.0.0.0', + 'msvs_target_platform_minversion':'9.0.0.0' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_missing_platversion_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'sources': [ + 'dllmain.cc', + ], + }, + ] +} -- cgit v1.2.3