Skip to content

Conversation

@vimanyu
Copy link
Contributor

@vimanyu vimanyu commented Oct 6, 2020

  • Support configurations that do not ship with vcpkg by creating custom files on the fly and using those in the build process.
  • Handle x86 on Windows (by appending -A Win32 to cmake configure)
  • New flag "--crt_linkage" in build_desktop.py that sets the runtime linkage in MSVC (Windows only) for libraries built with vcpkg
 # /MD --crt_linkage dynamic # /MT --crt_linkage static 

Context:
vcpkg ships with default configurations for different platforms,
eg: x64-linux, x64-osx, x64-windows, x64-windows-static

Each of these configurations is a file containing various options (example: contents of x64-linux.cmake),

set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_CMAKE_SYSTEM_NAME Linux) 

We can provide custom configuration files to the vcpkg and leverage these new files in our build process.

Vcpkg ships with few prebuilt configurations and for any custom build configs, we have to create new vcpkg files. These changes take care of creating necessary files for vcpkg before building.
Prints out cmake options that should be used to point to libs built with vcpkg.
@vimanyu vimanyu self-assigned this Oct 6, 2020
@google-cla google-cla bot added the cla: yes label Oct 6, 2020
Copy link
Contributor

@DellaBitta DellaBitta left a comment

Choose a reason for hiding this comment

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

Adding a comment but leaving the previous review as the gating approval.

@anonymous-akorn
Copy link
Contributor

Another thing to consider is how easy it will be to debug this if something goes wrong in this logic: it could cause an error far downstream (like a missing dependency), and might not be easy to figure out what went wrong or why.

Since the response files are small, I think it would be good to print their contents whenever modifying/generating one. e.g. in the logic to generate a response file out of an existing Linux response file, you could print both the Linux one used for the dependencies, and the new generated one. If nothing else, it'll help as a sanity check when going through CI logs.

anonymous-akorn
anonymous-akorn previously approved these changes Oct 7, 2020
@vimanyu vimanyu merged commit 06353d0 into dev Oct 8, 2020
@vimanyu vimanyu deleted the feature/support-non-standard-vcpkg-configs branch October 8, 2020 20:39
@firebase firebase locked and limited conversation to collaborators Nov 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3 participants