diff options
39 files changed, 81 insertions, 67 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1631641 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,19 @@ +# This is a good default: files that are auto-detected by git to be text are +# converted to the platform-native line ending (LF on Unix, CRLF on Windows) +# in the working tree and to LF in the repository. +# +* text=auto + +# Use `eol=crlf` for files that should have the CRLF line ending both in the +# working tree (even on Unix) and in the repository. +# +#*.bat text eol=crlf + +# Use `eol=lf` for files that should have the LF line ending both in the +# working tree (even on Windows) and in the repository. +# +#*.sh text eol=lf + +# Use `binary` to make sure certain files are never auto-detected as text. +# +#*.png binary @@ -0,0 +1,7 @@ +This file contains information about the build2 authors for copyright +purposes. + +The copyright for the code is held by the contributors of the code. The +revision history in the version control system is the primary source of +authorship information for copyright purposes. Contributors that have +requested to also be noted explicitly in this file are listed below: @@ -1,20 +1,21 @@ -Copyright (c) 2014-2019 Code Synthesis Ltd +MIT License -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: +Copyright (c) 2014-2021 the build2 authors (see the AUTHORS file). -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. @@ -1,2 +1,19 @@ -Note that while this project is called msvc-linux, you may be able to use it -on other UNIX-like systems supported by Wine. +Cross-compiling from UNIX to Windows with MSVC using Wine. + +NOTE: we no longer recommend using this approach unless you absolutely +must. Firstly, the whole setup is very hacky and brittle (and potentially +illegal: we were told it's against the license to run MSVC like that) and +often doesn't work with the most recent versions of MSVC (because Wine hasn't +caught up on the new APIs yet). Also, there are edge cases where build2 does +not fully support this "mode" of running MSVC. It works for projects that +don't do anything unusual, but, for example, you won't be able to build +anything that requires MASM. We believe if you must test with MSVC, the only +sane way to do it is with a Windows VM (which is what we do on our CI). If you +just need to test that your code builds for Windows, another option is to use +Clang and the LLVM linker (lld-link) as a cross-compiler. With this approach +you will only need to copy the MSVC standard library and PlatformSDK (and +won't need to mess with Wine). + +See INSTALL for setup instructions. Note that while this project is called +msvc-linux, you may be able to use it on other UNIX-like systems supported +by Wine. diff --git a/build/bootstrap.build b/build/bootstrap.build index aa11bc1..278fd32 100644 --- a/build/bootstrap.build +++ b/build/bootstrap.build @@ -1,5 +1,4 @@ # file : build/bootstrap.build -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file project = msvc-linux diff --git a/build/root.build b/build/root.build index fed56db..badb530 100644 --- a/build/root.build +++ b/build/root.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file cxx.std = latest @@ -11,4 +10,7 @@ ixx{*}: extension = ixx txx{*}: extension = txx cxx{*}: extension = cxx +if ($cxx.id == 'gcc') + cxx.coptions += -Wno-maybe-uninitialized -Wno-free-nonheap-object # libbutl + cxx.poptions =+ "-I$out_root" "-I$src_root" @@ -1,5 +1,4 @@ # file : buildfile -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file define sh: file @@ -10,10 +9,11 @@ sh{*}: install = bin/ } -./: msvc-common/exe{msvc-filter} \ - sh{cl-* lib-* link-* mt-* rc-*} \ - sh{msvc-** -msvc-common/msvc-filter*} \ - doc{INSTALL LICENSE NEWS README} manifest +./: msvc-common/exe{msvc-filter} \ + sh{cl-* lib-* link-* mt-* rc-*} \ + sh{msvc-** -msvc-common/msvc-filter*} \ + doc{INSTALL NEWS README} legal{LICENSE AUTHORS} \ + manifest msvc-common/ { diff --git a/etc/lowercase-headers b/etc/lowercase-headers index 5bf6fc3..3e13f71 100755 --- a/etc/lowercase-headers +++ b/etc/lowercase-headers @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : etc/lowercase-headers -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Create all-lowercase symlinks for .h headers in <dir> (recursively) that @@ -1,6 +1,6 @@ : 1 name: msvc-linux -version: 0.12.0 +version: 0.17.0-a.0.z project: build2 summary: MS Visual C++ as cross-compiler driver scripts license: MIT @@ -12,8 +12,8 @@ url: https://build2.org doc-url: https://build2.org/doc.xhtml src-url: https://git.build2.org/cgit/etc/msvc-linux/tree/ email: users@build2.org -build-email: builds@build2.org +build-warning-email: builds@build2.org requires: c++14 -depends: * build2 >= 0.12.0 -depends: * bpkg >= 0.12.0 -depends: libbutl ^0.12.0 +depends: * build2 >= 0.16.0- +depends: * bpkg >= 0.16.0- +depends: libbutl [0.17.0-a.0.1 0.17.0-a.1) diff --git a/msvc-11/msvc-11-32 b/msvc-11/msvc-11-32 index b2cbea8..c6498ca 100755 --- a/msvc-11/msvc-11-32 +++ b/msvc-11/msvc-11-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-11/msvc-11-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 11 32-bit setup/configuration. diff --git a/msvc-12/msvc-12-32 b/msvc-12/msvc-12-32 index 515275d..6c4207d 100755 --- a/msvc-12/msvc-12-32 +++ b/msvc-12/msvc-12-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-12/msvc-12-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 12 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-14/msvc-14.0-32 b/msvc-14/msvc-14.0-32 index 74de769..811a696 100755 --- a/msvc-14/msvc-14.0-32 +++ b/msvc-14/msvc-14.0-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-14/msvc-14.0-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 14 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-14/msvc-14.2-32 b/msvc-14/msvc-14.2-32 index 5a01648..f381880 100755 --- a/msvc-14/msvc-14.2-32 +++ b/msvc-14/msvc-14.2-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-14/msvc-14.2-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 14U2 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-14/msvc-14.2-64 b/msvc-14/msvc-14.2-64 index 669a1eb..6231563 100755 --- a/msvc-14/msvc-14.2-64 +++ b/msvc-14/msvc-14.2-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-14/msvc-14.2-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 14U2 64-bit setup/configuration. diff --git a/msvc-14/msvc-14.3-32 b/msvc-14/msvc-14.3-32 index 4905d2c..ce3b98d 100755 --- a/msvc-14/msvc-14.3-32 +++ b/msvc-14/msvc-14.3-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-14/msvc-14.3-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 14U3 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-14/msvc-14.3-64 b/msvc-14/msvc-14.3-64 index 64e4c12..2ef96ca 100755 --- a/msvc-14/msvc-14.3-64 +++ b/msvc-14/msvc-14.3-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-14/msvc-14.3-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 14U3 64-bit setup/configuration. diff --git a/msvc-15/msvc-15.0-32 b/msvc-15/msvc-15.0-32 index 1ac12b8..33769cd 100755 --- a/msvc-15/msvc-15.0-32 +++ b/msvc-15/msvc-15.0-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.0-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 15 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-15/msvc-15.0-64 b/msvc-15/msvc-15.0-64 index 34db54f..13c31ac 100755 --- a/msvc-15/msvc-15.0-64 +++ b/msvc-15/msvc-15.0-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.0-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-15/msvc-15.3-32 b/msvc-15/msvc-15.3-32 index 42ee2e5..5a9df69 100755 --- a/msvc-15/msvc-15.3-32 +++ b/msvc-15/msvc-15.3-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.3-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 15 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-15/msvc-15.3-64 b/msvc-15/msvc-15.3-64 index 342f871..5e453ea 100755 --- a/msvc-15/msvc-15.3-64 +++ b/msvc-15/msvc-15.3-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.3-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-15/msvc-15.5-32 b/msvc-15/msvc-15.5-32 index 482e764..f59a46f 100755 --- a/msvc-15/msvc-15.5-32 +++ b/msvc-15/msvc-15.5-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.5-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 15 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-15/msvc-15.5-64 b/msvc-15/msvc-15.5-64 index 71672ab..b59d052 100755 --- a/msvc-15/msvc-15.5-64 +++ b/msvc-15/msvc-15.5-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.5-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-15/msvc-15.6-32 b/msvc-15/msvc-15.6-32 index e687e1f..09a3330 100755 --- a/msvc-15/msvc-15.6-32 +++ b/msvc-15/msvc-15.6-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.6-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 15 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-15/msvc-15.6-64 b/msvc-15/msvc-15.6-64 index 7aa5544..6e49563 100755 --- a/msvc-15/msvc-15.6-64 +++ b/msvc-15/msvc-15.6-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.6-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-15/msvc-15.7-32 b/msvc-15/msvc-15.7-32 index 46d8bab..5138415 100755 --- a/msvc-15/msvc-15.7-32 +++ b/msvc-15/msvc-15.7-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.7-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 15 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-15/msvc-15.7-64 b/msvc-15/msvc-15.7-64 index f2fd607..50d2a89 100755 --- a/msvc-15/msvc-15.7-64 +++ b/msvc-15/msvc-15.7-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-15/msvc-15.7-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-16/msvc-16.0-32 b/msvc-16/msvc-16.0-32 index 022c4b4..97c2cdc 100755 --- a/msvc-16/msvc-16.0-32 +++ b/msvc-16/msvc-16.0-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-16/msvc-16.0-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 16 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-16/msvc-16.0-64 b/msvc-16/msvc-16.0-64 index 4f8a70f..35d5837 100755 --- a/msvc-16/msvc-16.0-64 +++ b/msvc-16/msvc-16.0-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-16/msvc-16.0-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-16/msvc-16.1-32 b/msvc-16/msvc-16.1-32 index 65def42..9c06497 100755 --- a/msvc-16/msvc-16.1-32 +++ b/msvc-16/msvc-16.1-32 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-16/msvc-16.1-32 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 16 32-bit setup/configuration (note: using 64-to-32 cross-compiler). diff --git a/msvc-16/msvc-16.1-64 b/msvc-16/msvc-16.1-64 index ce6c433..c86dbd2 100755 --- a/msvc-16/msvc-16.1-64 +++ b/msvc-16/msvc-16.1-64 @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-16/msvc-16.1-64 -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # MSVC 64-bit setup/configuration. diff --git a/msvc-common/msvc-cl-common b/msvc-common/msvc-cl-common index 5cfa057..91a5763 100755 --- a/msvc-common/msvc-cl-common +++ b/msvc-common/msvc-cl-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-cl-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_dir must be set. diff --git a/msvc-common/msvc-common b/msvc-common/msvc-common index 8d4e87e..e7ace79 100755 --- a/msvc-common/msvc-common +++ b/msvc-common/msvc-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_dir must be set. diff --git a/msvc-common/msvc-filter.cxx b/msvc-common/msvc-filter.cxx index 662c448..feff7d8 100644 --- a/msvc-common/msvc-filter.cxx +++ b/msvc-common/msvc-filter.cxx @@ -1,5 +1,4 @@ // file : msvc-common/msvc-filter.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include <sys/time.h> // timeval @@ -15,11 +14,11 @@ #include <system_error> #include <unordered_map> -#include <libbutl/path.mxx> // path::traits::realize() -#include <libbutl/utility.mxx> // alpha(), throw_*_error() -#include <libbutl/process.mxx> -#include <libbutl/optional.mxx> -#include <libbutl/fdstream.mxx> +#include <libbutl/path.hxx> // path::traits::realize() +#include <libbutl/utility.hxx> // alpha(), throw_*_error() +#include <libbutl/process.hxx> +#include <libbutl/optional.hxx> +#include <libbutl/fdstream.hxx> #include <msvc-common/version.hxx> diff --git a/msvc-common/msvc-lib-common b/msvc-common/msvc-lib-common index b7bce1f..5dca5cc 100755 --- a/msvc-common/msvc-lib-common +++ b/msvc-common/msvc-lib-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-lib-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_dir must be set. diff --git a/msvc-common/msvc-link-common b/msvc-common/msvc-link-common index fdddf61..45e542c 100755 --- a/msvc-common/msvc-link-common +++ b/msvc-common/msvc-link-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-link-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_exe and src_dir must be set. diff --git a/msvc-common/msvc-mt-common b/msvc-common/msvc-mt-common index b0a6f7b..317b462 100755 --- a/msvc-common/msvc-mt-common +++ b/msvc-common/msvc-mt-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-mt-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_dir must be set. diff --git a/msvc-common/msvc-rc-common b/msvc-common/msvc-rc-common index 8f6980f..f9d3b76 100755 --- a/msvc-common/msvc-rc-common +++ b/msvc-common/msvc-rc-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-rc-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Note: shouldn't be executed directly, src_dir must be set. diff --git a/msvc-common/msvc-sdk-common b/msvc-common/msvc-sdk-common index a79777a..3ad0a29 100755 --- a/msvc-common/msvc-sdk-common +++ b/msvc-common/msvc-sdk-common @@ -1,7 +1,6 @@ #! /usr/bin/env bash # file : msvc-common/msvc-sdk-common -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file # Figure out the latest Windows 10 SDK version. Fail if none is found. diff --git a/msvc-common/version.hxx.in b/msvc-common/version.hxx.in index 02630b8..8676883 100644 --- a/msvc-common/version.hxx.in +++ b/msvc-common/version.hxx.in @@ -1,5 +1,4 @@ // file : msvc-common/version.hxx.in -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef MSVC_FILTER_VERSION // Note: using the version macro itself. |