Skip to content

[vcpkg] Clean up CMake build system#10834

Merged
strega-nil merged 1 commit intomicrosoft:masterfrom
strega-nil:cmake-updates
Apr 15, 2020
Merged

[vcpkg] Clean up CMake build system#10834
strega-nil merged 1 commit intomicrosoft:masterfrom
strega-nil:cmake-updates

Conversation

@strega-nil
Copy link
Copy Markdown
Contributor

There are quite a few changes to the CMake build system packaged up into
one set here:

  • Added toolsrc/cmake/utilities.cmake, which contains the following:
    • vcpkg_detect_compiler -- get the name of the C++ compiler, as one
      of {gcc, clang, msvc}
    • vcpkg_detect_standard_library -- get the name of the standard
      library we're linking to, as one of {libstdc++, libc++, msvc-stl}
    • vcpkg_detect_std_filesystem -- figure out how to link and call
      into C++17's filesystem; whether one needs to link to stdc++fs or
      c++fs, and whether to use <filesystem> or
      <experimental/filesystem>.
  • Added a VCPKG_WARNINGS_AS_ERRORS, split off from
    VCPKG_DEVELOPMENT_WARNINGS, which allows one to use the development
    warnings without passing -Werror
  • Rename DEFINE_DISABLE_METRICS to VCPKG_DISABLE_METRICS -- the
    former will now print a deprecation message and set the latter.
  • Now, print a deprecation message on WERROR; it doesn't do anything
    since the behavior it requested is now the default.
  • Pass -std=c++17 if the compiler allows it, instead of -std=c++1z
  • Do some code movement
  • Pass USE_STD_FILESYSTEM if possible, instead of only on minGW
    • Renamed to VCPKG_USE_STD_FILESYSTEM

Additionally, we now pass /W4 in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.

And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.

Copy link
Copy Markdown
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@strega-nil
Copy link
Copy Markdown
Contributor Author

Thanks for the review billy!

There are quite a few changes to the CMake build system packaged up into
one set here:
* Added `toolsrc/cmake/utilities.cmake`, which contains the following:
  * `vcpkg_detect_compiler` -- get the name of the C++ compiler, as one
    of {gcc, clang, msvc}
  * `vcpkg_detect_standard_library` -- get the name of the standard
    library we're linking to, as one of {libstdc++, libc++, msvc-stl}
  * `vcpkg_detect_std_filesystem` -- figure out how to link and call
    into C++17's filesystem; whether one needs to link to `stdc++fs` or
    `c++fs`, and whether to use `<filesystem>` or
    `<experimental/filesystem>`.
* Added a `VCPKG_WARNINGS_AS_ERRORS`, split off from
  `VCPKG_DEVELOPMENT_WARNINGS`, which allows one to use the development
  warnings without passing -Werror
* Rename `DEFINE_DISABLE_METRICS` to `VCPKG_DISABLE_METRICS` -- the
  former will now print a deprecation message and set the latter.
* Now, print a deprecation message on `WERROR`; it doesn't do anything
  since the behavior it requested is now the default.
* Pass `-std=c++17` if the compiler allows it, instead of `-std=c++1z`
* Do some code movement
* Pass `USE_STD_FILESYSTEM` if possible, instead of only on minGW
  * Renamed to `VCPKG_USE_STD_FILESYSTEM`

Additionally, we now pass `/W4` in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.

And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.
@strega-nil strega-nil merged commit 22623e3 into microsoft:master Apr 15, 2020
@strega-nil strega-nil deleted the cmake-updates branch April 15, 2020 05:11
@miketimofeev
Copy link
Copy Markdown

@strega-nil @BillyONeal Hi, folks!
It looks like this PR breaks bootstrap process. There is an error both on macOS and ubuntu:

Extracting ninja...
Extracting ninja... done.
CMake Error: The source directory "/home/testAdm2/toolsrc" does not exist.

Previous commit works fine

@strega-nil
Copy link
Copy Markdown
Contributor Author

@miketimofeev that's really odd... I think I know why it's broken though, lemme fix it. I guess we should test whether it's possible to bootstrap from not-the-vcpkg directory.

@miketimofeev
Copy link
Copy Markdown

@strega-nil thank you!

Jimmy-Hu added a commit to Jimmy-Hu/vcpkg that referenced this pull request Apr 16, 2020
[vcpkg] Clean up CMake build system (microsoft#10834)
strega-nil added a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
There are quite a few changes to the CMake build system packaged up into
one set here:
* Added `toolsrc/cmake/utilities.cmake`, which contains the following:
  * `vcpkg_detect_compiler` -- get the name of the C++ compiler, as one
    of {gcc, clang, msvc}
  * `vcpkg_detect_standard_library` -- get the name of the standard
    library we're linking to, as one of {libstdc++, libc++, msvc-stl}
  * `vcpkg_detect_std_filesystem` -- figure out how to link and call
    into C++17's filesystem; whether one needs to link to `stdc++fs` or
    `c++fs`, and whether to use `<filesystem>` or
    `<experimental/filesystem>`.
* Added a `VCPKG_WARNINGS_AS_ERRORS`, split off from
  `VCPKG_DEVELOPMENT_WARNINGS`, which allows one to use the development
  warnings without passing -Werror
* Rename `DEFINE_DISABLE_METRICS` to `VCPKG_DISABLE_METRICS` -- the
  former will now print a deprecation message and set the latter.
* Now, print a deprecation message on `WERROR`; it doesn't do anything
  since the behavior it requested is now the default.
* Pass `-std=c++17` if the compiler allows it, instead of `-std=c++1z`
* Do some code movement
* Pass `USE_STD_FILESYSTEM` if possible, instead of only on minGW
  * Renamed to `VCPKG_USE_STD_FILESYSTEM`

Additionally, we now pass `/W4` in Debug mode on x86 in the Visual
Studio build system; this brings it in line with the CMake build system,
and the x64 Visual Studio build system.

And finally, we make some minor code changes to support compiling in
VCPKG_DEVELOPMENT_WARNINGS mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants