-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct windows build flags for clang-cl/msvc-cl under opt/fastbuild/…
…dbg (#13133) Commit Message: Clean up build flags for clang + msvc opt/fastbuild/dbg Additional Description: - Move what were '--config=msvc-cl' settings out of .bazelrc into the default cflags for Windows compilation. This enables bazel build ... and bazel test ... to simply work out of the box. - Cleans up .bazelrc lists of windows vs. clang-cl settings, dividing the list into desired toggles vs. bazel or envoy bug workarounds - Fix errors in curl library creation in fastbuild on Windows - Introduce toggles and defaults for alwayslink argument to library objects. Defaults remain the same for now. - Introduce, but do not toggle clang-cl flags (this will arrive in a later PR when we resolve the opt build errors missing intrinsic base class destructors in the mock classes) Risk Level: low Testing: local, msvc and clang-cl on windows Docs Changes: n/a Release Notes: n/a Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]>
- Loading branch information
1 parent
8a1d444
commit 3c86d8d
Showing
18 changed files
with
121 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index ec1cfa782..0c5a72f00 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -42,0 +42,5 @@ | ||
+# revert CMake bug triggered by curl's defined max CMake policy version, see https://gitlab.kitware.com/cmake/cmake/-/issues/21288 | ||
+if(POLICY CMP0091) | ||
+ cmake_policy(SET CMP0091 OLD) | ||
+endif() | ||
+ | ||
@@ -249,3 +254,6 @@ | ||
- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") | ||
- set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") | ||
+ foreach(build_suffix "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO) | ||
+ set(flags_var CMAKE_C_FLAGS${build_suffix}) | ||
+ if("${${flags_var}}" MATCHES "/MD") | ||
+ string(REGEX REPLACE "/MD" "/MT" ${flags_var} "${${flags_var}}") | ||
+ endif() | ||
+ endforeach() | ||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
index 911c9096d..ba6af1bf1 100644 | ||
--- a/lib/CMakeLists.txt | ||
+++ b/lib/CMakeLists.txt | ||
@@ -91,4 +91,0 @@ add_library( | ||
-if(MSVC AND NOT BUILD_SHARED_LIBS) | ||
- set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) | ||
-endif() | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters