forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: enable release builds on Windows (envoyproxy#5812)
Now that envoyproxy#5218 has been merged, we can enable release builds on Windows. This PR updates `ci/do_ci.ps1` to build release + fastbuild versions in addition to debug versions. It also removes support for build scripts in `ci/build_container/build_recipes/` on Windows, as there is no clean way to pass information from Bazel regarding the type of build to those scripts Risk Level: Low Testing: `bazel build //source/... && bazel test //test/...` Signed-off-by: Sam Smith <sesmith177@gmail.com> Signed-off-by: Fred Douglas <fredlas@google.com>
- Loading branch information
1 parent
53a35fc
commit d558951
Showing
9 changed files
with
188 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,101 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("//bazel:envoy_build_system.bzl", "envoy_package") | ||
load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") | ||
load("//bazel:envoy_build_system.bzl", "envoy_cmake_external", "envoy_package") | ||
|
||
envoy_package() | ||
|
||
cmake_external( | ||
envoy_cmake_external( | ||
name = "ares", | ||
cache_entries = { | ||
"CARES_SHARED": "no", | ||
"CARES_STATIC": "on", | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo", | ||
}, | ||
cmake_options = ["-GNinja"], | ||
copy_pdb = True, | ||
lib_source = "@com_github_c_ares_c_ares//:all", | ||
make_commands = [ | ||
"ninja", | ||
"ninja install", | ||
], | ||
static_libraries = ["libcares.a"], | ||
pdb_name = "c-ares", | ||
static_libraries = select({ | ||
"//bazel:windows_x86_64": ["cares.lib"], | ||
"//conditions:default": ["libcares.a"], | ||
}), | ||
) | ||
|
||
cmake_external( | ||
envoy_cmake_external( | ||
name = "benchmark", | ||
cache_entries = { | ||
"BENCHMARK_ENABLE_GTEST_TESTS": "OFF", | ||
"BENCHMARK_ENABLE_TESTING": "OFF", | ||
}, | ||
copy_pdb = True, | ||
lib_source = "@com_github_google_benchmark//:all", | ||
postfix_script = "mkdir -p $INSTALLDIR/include/testing/base/public && cp $BUILD_TMPDIR/$INSTALL_PREFIX/include/benchmark/benchmark.h $INSTALLDIR/include/testing/base/public/benchmark.h", | ||
static_libraries = select({ | ||
"//bazel:windows_x86_64": ["benchmark.lib"], | ||
"//conditions:default": ["libbenchmark.a"], | ||
}), | ||
) | ||
|
||
envoy_cmake_external( | ||
name = "event", | ||
cache_entries = { | ||
"EVENT__DISABLE_OPENSSL": "on", | ||
"EVENT__DISABLE_REGRESS": "on", | ||
"CMAKE_BUILD_TYPE": "Release", | ||
}, | ||
cmake_options = ["-GNinja"], | ||
copy_pdb = True, | ||
lib_source = "@com_github_libevent_libevent//:all", | ||
make_commands = [ | ||
"ninja", | ||
"ninja install", | ||
], | ||
static_libraries = ["libevent.a"], | ||
static_libraries = select({ | ||
"//bazel:windows_x86_64": ["event.lib"], | ||
"//conditions:default": ["libevent.a"], | ||
}), | ||
) | ||
|
||
cmake_external( | ||
envoy_cmake_external( | ||
name = "nghttp2", | ||
cache_entries = { | ||
"ENABLE_STATIC_LIB": "on", | ||
"ENABLE_LIB_ONLY": "on", | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo", | ||
"CMAKE_INSTALL_LIBDIR": "lib", | ||
}, | ||
cmake_options = ["-GNinja"], | ||
cmake_files_dir = "$BUILD_TMPDIR/lib/CMakeFiles", | ||
copy_pdb = True, | ||
lib_source = "@com_github_nghttp2_nghttp2//:all", | ||
make_commands = [ | ||
"ninja", | ||
"ninja install", | ||
], | ||
static_libraries = ["libnghttp2.a"], | ||
pdb_name = "nghttp2_static", | ||
static_libraries = select({ | ||
"//bazel:windows_x86_64": ["nghttp2_static.lib"], | ||
"//conditions:default": ["libnghttp2_static.a"], | ||
}), | ||
) | ||
|
||
cmake_external( | ||
envoy_cmake_external( | ||
name = "yaml", | ||
cache_entries = { | ||
"YAML_CPP_BUILD_TESTS": "off", | ||
"YAML_CPP_BUILD_TOOLS": "off", | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo", | ||
}, | ||
cmake_options = ["-GNinja"], | ||
lib_source = "@com_github_jbeder_yaml_cpp//:all", | ||
make_commands = [ | ||
"ninja", | ||
"ninja install", | ||
], | ||
static_libraries = ["libyaml-cpp.a"], | ||
static_libraries = select({ | ||
"//bazel:windows_dbg_build": ["libyaml-cppmdd.lib"], | ||
"//bazel:windows_fastbuild_build": ["libyaml-cppmd.lib"], | ||
"//bazel:windows_opt_build": ["libyaml-cppmd.lib"], | ||
"//conditions:default": ["libyaml-cpp.a"], | ||
}), | ||
) | ||
|
||
cmake_external( | ||
envoy_cmake_external( | ||
name = "zlib", | ||
cache_entries = { | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo", | ||
}, | ||
cmake_options = ["-GNinja"], | ||
copy_pdb = True, | ||
lib_source = "@com_github_madler_zlib//:all", | ||
make_commands = [ | ||
"ninja", | ||
"ninja install", | ||
], | ||
static_libraries = ["libz.a"], | ||
pdb_name = "zlibstatic", | ||
static_libraries = select({ | ||
"//bazel:windows_dbg_build": ["zlibstaticd.lib"], | ||
"//bazel:windows_fastbuild_build": ["zlibstatic.lib"], | ||
"//bazel:windows_opt_build": ["zlibstatic.lib"], | ||
"//conditions:default": ["libz.a"], | ||
}), | ||
) |
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 |
---|---|---|
@@ -1,12 +1,29 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index e70d2d49..f9c5340e 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -273,7 +273,11 @@ check_type_size("ssize_t" SIZEOF_SSIZE_T) | ||
if(SIZEOF_SSIZE_T STREQUAL "") | ||
# ssize_t is a signed type in POSIX storing at least -1. | ||
# Set it to "int" to match the behavior of AC_TYPE_SSIZE_T (autotools). | ||
- set(ssize_t int) | ||
+ if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
+ set(ssize_t int64_t) | ||
+ else() | ||
+ set(ssize_t int) | ||
+ endif() | ||
endif() | ||
# AC_TYPE_UINT8_T | ||
# AC_TYPE_UINT16_T | ||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
index 17e422b2..e58070f5 100644 | ||
index 17e422b2..a10f82a5 100644 | ||
--- a/lib/CMakeLists.txt | ||
+++ b/lib/CMakeLists.txt | ||
@@ -52,6 +52,7 @@ | ||
@@ -56,6 +56,7 @@ if(HAVE_CUNIT OR ENABLE_STATIC_LIB) | ||
COMPILE_FLAGS "${WARNCFLAGS}" | ||
VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} | ||
ARCHIVE_OUTPUT_NAME nghttp2 | ||
+ ARCHIVE_OUTPUT_DIRECTORY static | ||
+ ARCHIVE_OUTPUT_NAME nghttp2_static | ||
) | ||
target_compile_definitions(nghttp2_static PUBLIC "-DNGHTTP2_STATICLIB") | ||
if(ENABLE_STATIC_LIB) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.