mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-07 07:02:53 +03:00
getdeps: prefer MSVC over gcc when building on GitHub Actions CI
Summary: while testing https://github.com/facebook/watchman/pull/743 I noticed that the cmake builds were picking up the installed mingw GCC compiler rather than the MSVC compiler. That would be fine except that boost is built with MSVC and its generated libraries cannot be subsequently found by a cmake gcc build that uses FindBoost. This commit forces cmake to pick cl.exe rather than gcc. This is probably fine to do unconditionally on windows, but since I've only observed this particular problem with GitHub Actions I'm keeping it constrained to that environment for now. Reviewed By: simpkins Differential Revision: D17385050 fbshipit-source-id: 90bef898b138e5d4bbd28a155ed1bd468acee9de
This commit is contained in:
committed by
Facebook Github Bot
parent
e647a0a9c0
commit
a798142759
@@ -340,6 +340,16 @@ if __name__ == "__main__":
|
||||
ccache = path_search(env, "ccache")
|
||||
if ccache:
|
||||
defines["CMAKE_CXX_COMPILER_LAUNCHER"] = ccache
|
||||
|
||||
if "GITHUB_ACTIONS" in os.environ and self.build_opts.is_windows():
|
||||
# GitHub actions: the host has both gcc and msvc installed, and
|
||||
# the default behavior of cmake is to prefer gcc.
|
||||
# Instruct cmake that we want it to use cl.exe; this is important
|
||||
# because Boost prefers cl.exe and the mismatch results in cmake
|
||||
# with gcc not being able to find boost built with cl.exe.
|
||||
defines["CMAKE_C_COMPILER"] = "cl.exe"
|
||||
defines["CMAKE_CXX_COMPILER"] = "cl.exe"
|
||||
|
||||
if self.build_opts.is_darwin():
|
||||
# Try to persuade cmake to set the rpath to match the lib
|
||||
# dirs of the dependencies. This isn't automatic, and to
|
||||
|
Reference in New Issue
Block a user