diff options
author | murgatroid99 <mlumish@google.com> | 2016-01-08 12:33:22 -0800 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2016-01-08 12:33:22 -0800 |
commit | 8b791a4a7f784fb367af6e56c2596c578e974338 (patch) | |
tree | ab7baa05c08aeac191768fadc766866434beb36b /templates | |
parent | c357749b48720e00bce57c26acb2195047d63263 (diff) | |
parent | b47eab53dec9a6d811ad26e0873dc7ec1bac7d46 (diff) |
Merged from master and resolved merge conflicts
Diffstat (limited to 'templates')
19 files changed, 316 insertions, 280 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template index 394ffb8c51..a09dd794ad 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -154,7 +154,6 @@ LD_valgrind = $(DEFAULT_CC) LDXX_valgrind = $(DEFAULT_CXX) CPPFLAGS_valgrind = -O0 - OPENSSL_CFLAGS_valgrind = -DPURIFY LDFLAGS_valgrind = -rdynamic DEFINES_valgrind = _DEBUG DEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=20 @@ -164,8 +163,9 @@ CXX_tsan = clang++ LD_tsan = clang LDXX_tsan = clang++ - CPPFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument - LDFLAGS_tsan = -fsanitize=thread + CFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -fPIE + CXXFLAGS_tsan = -O0 -fsanitize=thread -fno-omit-frame-pointer -Wno-unused-command-line-argument -fPIE + LDFLAGS_tsan = -fsanitize=thread -pie DEFINES_tsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=10 VALID_CONFIG_asan = 1 @@ -174,7 +174,8 @@ CXX_asan = clang++ LD_asan = clang LDXX_asan = clang++ - CPPFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument + CFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument + CXXFLAGS_asan = -O0 -fsanitize=address -fno-omit-frame-pointer -Wno-unused-command-line-argument LDFLAGS_asan = -fsanitize=address DEFINES_asan = GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3 @@ -184,9 +185,9 @@ CXX_msan = clang++-libc++ LD_msan = clang LDXX_msan = clang++-libc++ - CPPFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument - OPENSSL_CFLAGS_msan = -DPURIFY - LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 + CFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument -fPIE + CXXFLAGS_msan = -O0 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-command-line-argument -fPIE + LDFLAGS_msan = -fsanitize=memory -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_USE_OWN_TR1_TUPLE=1 -pie DEFINES_msan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=4 VALID_CONFIG_ubsan = 1 @@ -195,8 +196,8 @@ CXX_ubsan = clang++ LD_ubsan = clang LDXX_ubsan = clang++ - CPPFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument - OPENSSL_CFLAGS_ubsan = -DPURIFY + CFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument + CXXFLAGS_ubsan = -O1 -fsanitize=undefined -fno-omit-frame-pointer -Wno-unused-command-line-argument LDFLAGS_ubsan = -fsanitize=undefined DEFINES_ubsan = NDEBUG GRPC_TEST_SLOWDOWN_BUILD_FACTOR=3 @@ -205,7 +206,8 @@ CXX_gcov = g++ LD_gcov = gcc LDXX_gcov = g++ - CPPFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage -Wno-return-type + CFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage -Wno-return-type + CXXFLAGS_gcov = -O0 -fprofile-arcs -ftest-coverage -Wno-return-type LDFLAGS_gcov = -fprofile-arcs -ftest-coverage -rdynamic DEFINES_gcov = _DEBUG DEBUG GPR_GCOV @@ -264,16 +266,19 @@ DEFINES += $(EXTRA_DEFINES) endif - CFLAGS += -std=c89 -pedantic -Wsign-conversion -Wconversion -Wshadow + CFLAGS += -std=c99 -Wsign-conversion -Wconversion -Wshadow ifeq ($(HAS_CXX11),true) CXXFLAGS += -std=c++11 else CXXFLAGS += -std=c++0x endif - CPPFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter + CFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter + CXXFLAGS += -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter LDFLAGS += -g CPPFLAGS += $(CPPFLAGS_$(CONFIG)) + CFLAGS += $(CFLAGS_$(CONFIG)) + CXXFLAGS += $(CXXFLAGS_$(CONFIG)) DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\" LDFLAGS += $(LDFLAGS_$(CONFIG)) @@ -309,12 +314,12 @@ endif ifeq ($(SYSTEM),Linux) - LIBS = rt m z pthread + LIBS = rt m pthread LDFLAGS += -pthread endif ifeq ($(SYSTEM),MINGW32) - LIBS = m z pthread + LIBS = m pthread LDFLAGS += -pthread endif @@ -343,7 +348,6 @@ HOST_LDFLAGS = $(LDFLAGS) HOST_LDLIBS = $(LDLIBS) - # These are automatically computed variables. # There shouldn't be any need to change anything from now on. @@ -510,7 +514,7 @@ # Note that for testing purposes, one can do: # make HAS_EMBEDDED_OPENSSL_ALPN=false # to emulate the fact we do not have OpenSSL in the third_party folder. - ifeq ($(wildcard third_party/openssl/ssl/ssl.h),) + ifeq ($(wildcard third_party/boringssl/include/openssl/ssl.h),) HAS_EMBEDDED_OPENSSL_ALPN = false else HAS_EMBEDDED_OPENSSL_ALPN = true @@ -537,6 +541,7 @@ ifeq ($(HAS_SYSTEM_ZLIB),false) ifeq ($(HAS_EMBEDDED_ZLIB),true) ZLIB_DEP = $(LIBDIR)/$(CONFIG)/zlib/libz.a + ZLIB_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/zlib/libz.a CPPFLAGS += -Ithird_party/zlib LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib else @@ -546,9 +551,11 @@ ifeq ($(HAS_PKG_CONFIG),true) CPPFLAGS += $(shell $(PKG_CONFIG) --cflags zlib) LDFLAGS += $(shell $(PKG_CONFIG) --libs-only-L zlib) + LIBS += $(patsubst -l%,%,$(shell $(PKG_CONFIG) --libs-only-l zlib)) PC_REQUIRES_GRPC += zlib else PC_LIBS_GRPC += -lz + LIBS += z endif endif @@ -558,6 +565,34 @@ PC_LIBS_SECURE = ifeq ($(HAS_SYSTEM_OPENSSL_ALPN),true) + EMBED_OPENSSL ?= false + NO_SECURE ?= false + else # HAS_SYSTEM_OPENSSL_ALPN=false + ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true) + EMBED_OPENSSL ?= true + NO_SECURE ?= false + else # HAS_EMBEDDED_OPENSSL_ALPN=false + ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) + EMBED_OPENSSL ?= false + NO_SECURE ?= false + else + NO_SECURE ?= true + endif # HAS_SYSTEM_OPENSSL_NPN=true + endif # HAS_EMBEDDED_OPENSSL_ALPN + endif # HAS_SYSTEM_OPENSSL_ALPN + + OPENSSL_DEP := + OPENSSL_MERGE_LIBS := + ifeq ($(NO_SECURE),false) + ifeq ($(EMBED_OPENSSL),true) + OPENSSL_DEP += $(LIBDIR)/$(CONFIG)/libboringssl.a + OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/libboringssl.a + # need to prefix these to ensure overriding system libraries + CPPFLAGS := -Ithird_party/boringssl/include $(CPPFLAGS) + ifeq ($(OPENSSL_REQUIRES_DL),true) + LIBS_SECURE = dl + endif # OPENSSL_REQUIRES_DL + else # EMBED_OPENSSL=false ifeq ($(HAS_PKG_CONFIG),true) OPENSSL_PKG_CONFIG = true PC_REQUIRES_SECURE = openssl @@ -566,40 +601,22 @@ ifeq ($(SYSTEM),Linux) ifneq ($(LDFLAGS_OPENSSL_PKG_CONFIG),) LDFLAGS_OPENSSL_PKG_CONFIG += $(shell $(PKG_CONFIG) --libs-only-L openssl | sed s/L/Wl,-rpath,/) - endif - endif + endif # LDFLAGS_OPENSSL_PKG_CONFIG='' + endif # System=Linux LDFLAGS := $(LDFLAGS_OPENSSL_PKG_CONFIG) $(LDFLAGS) - else + else # HAS_PKG_CONFIG=false LIBS_SECURE = $(OPENSSL_LIBS) - ifeq ($(OPENSSL_REQUIRES_DL),true) - LIBS_SECURE += dl - PC_LIBS_SECURE = $(addprefix -l, $(LIBS_SECURE)) - endif - endif - else - ifeq ($(HAS_EMBEDDED_OPENSSL_ALPN),true) - USE_SYSTEM_OPENSSL = false - OPENSSL_DEP = $(LIBDIR)/$(CONFIG)/openssl/libssl.a - OPENSSL_MERGE_LIBS += $(LIBDIR)/$(CONFIG)/openssl/libssl.a $(LIBDIR)/$(CONFIG)/openssl/libcrypto.a - # need to prefix these to ensure overriding system libraries - CPPFLAGS := -Ithird_party/openssl/include $(CPPFLAGS) - LDFLAGS := -L$(LIBDIR)/$(CONFIG)/openssl $(LDFLAGS) - ifeq ($(OPENSSL_REQUIRES_DL),true) - LIBS_SECURE = dl - endif - else + endif # HAS_PKG_CONFIG ifeq ($(HAS_SYSTEM_OPENSSL_NPN),true) - USE_SYSTEM_OPENSSL = true CPPFLAGS += -DTSI_OPENSSL_ALPN_SUPPORT=0 LIBS_SECURE = $(OPENSSL_LIBS) + endif # HAS_SYSTEM_OPENSSL_NPN ifeq ($(OPENSSL_REQUIRES_DL),true) LIBS_SECURE += dl - endif - else - NO_SECURE = true - endif - endif - endif + PC_LIBS_SECURE = $(addprefix -l, $(LIBS_SECURE)) + endif # OPENSSL_REQUIRES_DL=true + endif # EMBED_OPENSSL + endif # NO_SECURE ifeq ($(OPENSSL_PKG_CONFIG),true) LDLIBS_SECURE += $(shell $(PKG_CONFIG) --libs-only-l openssl) @@ -831,44 +848,12 @@ $(LIBDIR)/$(CONFIG)/zlib/libz.a: $(E) "[MAKE] Building zlib" - $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(ZLIB_CFLAGS_EXTRA)" ./configure --static) + $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(CFLAGS_$(CONFIG)) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(ZLIB_CFLAGS_EXTRA)" ./configure --static) $(Q)$(MAKE) -C third_party/zlib clean $(Q)$(MAKE) -C third_party/zlib $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib $(Q)cp third_party/zlib/libz.a $(LIBDIR)/$(CONFIG)/zlib - $(LIBDIR)/$(CONFIG)/openssl/libssl.a: - $(E) "[MAKE] Building openssl for $(SYSTEM)" - ifeq ($(SYSTEM),Darwin) - $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_EXTRA)" ./Configure darwin64-x86_64-cc) - else - ifeq ($(SYSTEM),MINGW32) - @echo "We currently don't have a good way to compile OpenSSL in-place under msys." - @echo "Please provide a OpenSSL in your mingw32 system." - @echo - @echo "Note that you can find a compatible version of the libraries here:" - @echo - @echo "http://slproweb.com/products/Win32OpenSSL.html" - @echo - @echo "If you decide to install that one, take the full version. The light" - @echo "version only contains compiled DLLs, without the development files." - @echo - @echo "When installing, chose to copy the OpenSSL dlls to the OpenSSL binaries" - @echo "directory. This way we'll link to them directly." - @echo - @echo "You can then re-start the build the following way:" - @echo - @echo " CPPFLAGS=-I/c/OpenSSL-Win64/include LDFLAGS=-L/c/OpenSSL-Win64 make" - @false - else - $(Q)(cd third_party/openssl ; CC="$(CC) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_$(CONFIG)) $(OPENSSL_CFLAGS_EXTRA)" ./config no-asm $(OPENSSL_CONFIG_$(CONFIG))) - endif - endif - $(Q)$(MAKE) -j 1 -C third_party/openssl clean - $(Q)(unset CPPFLAGS; $(MAKE) -j 1 -C third_party/openssl build_crypto build_ssl) - $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/openssl - $(Q)cp third_party/openssl/libssl.a third_party/openssl/libcrypto.a $(LIBDIR)/$(CONFIG)/openssl - third_party/protobuf/configure: $(E) "[AUTOGEN] Preparing protobuf" $(Q)(cd third_party/protobuf ; autoreconf -f -i -Wall,no-obsolete) @@ -959,7 +944,7 @@ privatelibs_c: \ % for lib in libs: - % if lib.build == 'private' and lib.language == 'c' and not lib.get('external_deps', None): + % if lib.build == 'private' and lib.language == 'c' and not lib.get('external_deps', None) and not lib.boringssl: $(LIBDIR)/$(CONFIG)/lib${lib.name}.a\ % endif % endfor @@ -1533,6 +1518,16 @@ LIB${lib.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIB${lib.name.upper()}_SRC)))) + % if lib.boringssl: + # boringssl needs an override to ensure that it does not include + # system openssl headers regardless of other configuration + # we do so here with a target specific variable assignment + $(LIB${lib.name.upper()}_OBJS): CFLAGS := -Ithird_party/boringssl/include $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value -fvisibility=hidden + $(LIB${lib.name.upper()}_OBJS): CXXFLAGS := -Ithird_party/boringssl/include $(CXXFLAGS) -fvisibility=hidden + $(LIB${lib.name.upper()}_OBJS): CPPFLAGS += -DOPENSSL_NO_ASM -D_GNU_SOURCE + % else: + % endif + ## If the library requires OpenSSL, let's add some restrictions. % if lib.get('secure', 'check') == True or lib.get('secure', 'check') == 'check': ifeq ($(NO_SECURE),true) @@ -1590,7 +1585,7 @@ else % endif - $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP)\ + $(LIBDIR)/$(CONFIG)/lib${lib.name}.a: $(ZLIB_DEP) $(OPENSSL_DEP) \ % endif % if lib.language == 'c++': $(PROTOBUF_DEP)\ @@ -1601,16 +1596,32 @@ $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(Q) $(AR) rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(LIB${lib.name.upper()}_OBJS) % if lib.get('baselib', False): - % if lib.get('secure', 'check') == True: $(Q) rm -rf $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name} - $(Q) mkdir $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name} - $(Q) ( cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name} ; $(AR) x $(LIBDIR)/$(CONFIG)/lib${lib.name}.a ) - $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name} ; <%text>ar x $${l}</%text> ) ; done - $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/__.SYMDEF* - $(Q) ar rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/* + $(Q) ( mkdir -p $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/grpc ; <%text>\</%text> + cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/grpc ; <%text>\</%text> + $(AR) x $(LIBDIR)/$(CONFIG)/lib${lib.name}.a ) + $(Q) for l in $(ZLIB_MERGE_LIBS) ; do ( <%text>\</%text> + mkdir -p $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/zlib ; <%text>\</%text> + cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/zlib ; <%text>\</%text> + <%text>$(AR) x $${l}</%text> ) ; done + $(Q) for l in $(ZLIB_MERGE_LIBS) ; do ( <%text>\</%text> + mkdir -p $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/zlib ; <%text>\</%text> + cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/zlib ; <%text>\</%text> + <%text>$(AR) x $${l}</%text> ) ; done + % if lib.get('secure', 'check') == True: + $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( <%text>\</%text> + mkdir -p $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/ssl ; <%text>\</%text> + cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/ssl ; <%text>\</%text> + <%text>$(AR) x $${l}</%text> ) ; done + $(Q) for l in $(OPENSSL_MERGE_LIBS) ; do ( <%text>\</%text> + mkdir -p $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/ssl ; <%text>\</%text> + cd $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/ssl ; <%text>\</%text> + <%text>$(AR) x $${l}</%text> ) ; done + % endif + $(Q) rm -f $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/*/__.SYMDEF* + $(Q) ar rcs $(LIBDIR)/$(CONFIG)/lib${lib.name}.a $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name}/*/* $(Q) rm -rf $(BUILDDIR_ABSOLUTE)/tmp-merge-${lib.name} % endif - % endif ifeq ($(SYSTEM),Darwin) $(Q) ranlib $(LIBDIR)/$(CONFIG)/lib${lib.name}.a endif @@ -1643,6 +1654,7 @@ security = lib.get('secure', 'check') if security == True: common = common + ' $(OPENSSL_MERGE_LIBS) $(LDLIBS_SECURE)' + common = common + ' $(ZLIB_MERGE_LIBS)' if security in [True, 'check']: for src in lib.src: @@ -1732,6 +1744,17 @@ else % endif + + % if tgt.boringssl: + # boringssl needs an override to ensure that it does not include + # system openssl headers regardless of other configuration + # we do so here with a target specific variable assignment + $(${tgt.name.upper()}_OBJS): CFLAGS := -Ithird_party/boringssl/include $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value + $(${tgt.name.upper()}_OBJS): CXXFLAGS := -Ithird_party/boringssl/include $(CXXFLAGS) + $(${tgt.name.upper()}_OBJS): CPPFLAGS += -DOPENSSL_NO_ASM -D_GNU_SOURCE + % else: + % endif + ## ## We're not trying to add a dependency on building zlib and openssl here, ## as it's already done in the libraries. We're assuming that the build @@ -1765,7 +1788,7 @@ $(LIBDIR)/$(CONFIG)/lib${dep}.a\ % endfor - % if tgt.language == "c++": + % if tgt.language == "c++" or tgt.boringssl: ## C++ targets specificies. % if tgt.build == 'protoc': $(E) "[HOSTLD] Linking $@" @@ -1835,6 +1858,15 @@ $(LIBDIR)/$(CONFIG)/lib${dep}.a\ % endfor + % if tgt.language == 'c89': + % for src in tgt.src: + $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o : ${src} + $(E) "[C] Compiling $<" + $(Q) mkdir -p `dirname $@` + $(Q) $(CC) $(CFLAGS) $(CPPFLAGS) -std=c89 -pedantic -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< + % endfor + % endif + % endfor % if not has_no_sources: deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep) diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template index be80750eb7..8014ff3718 100644 --- a/templates/binding.gyp.template +++ b/templates/binding.gyp.template @@ -93,6 +93,11 @@ % for lib in libs: % if lib.name in module.transitive_deps: { + 'cflags': [ + '-std=c99', + '-Wall', + '-Werror' + ], 'target_name': '${lib.name}', 'product_prefix': 'lib', 'type': 'static_library', @@ -121,7 +126,7 @@ "<!(node -e \"require('nan')\")" ], 'cflags': [ - '-std=c++0x', + '-std=c++11', '-Wall', '-pthread', '-g', @@ -137,7 +142,6 @@ 'xcode_settings': { 'MACOSX_DEPLOYMENT_TARGET': '10.9', 'OTHER_CFLAGS': [ - '-std=c++11', '-stdlib=libc++' ] } diff --git a/templates/test/core/end2end/end2end_defs.include b/templates/test/core/end2end/end2end_defs.include new file mode 100644 index 0000000000..1b13bba94c --- /dev/null +++ b/templates/test/core/end2end/end2end_defs.include @@ -0,0 +1,67 @@ +<%def name="end2end_selector(tests)"> +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +<% tests = sorted(tests) %>\ +/* This file is auto-generated */ + +#include "test/core/end2end/end2end_tests.h" +#include <string.h> +#include <grpc/support/log.h> + +% for test in tests: +extern void ${test}(grpc_end2end_test_config config); +% endfor + +void grpc_end2end_tests(int argc, char **argv, + grpc_end2end_test_config config) { + int i; + + if (argc <= 1) { +% for test in tests: + ${test}(config); +% endfor + return; + } + + for (i = 1; i < argc; i++) { +% for test in tests: + if (0 == strcmp("${test}", argv[i])) { + ${test}(config); + continue; + } +% endfor + gpr_log(GPR_DEBUG, "not a test: '%%s'", argv[i]); + abort(); + } +}</%def>
\ No newline at end of file diff --git a/templates/test/core/end2end/end2end_nosec_tests.c.template b/templates/test/core/end2end/end2end_nosec_tests.c.template new file mode 100644 index 0000000000..3719ded75d --- /dev/null +++ b/templates/test/core/end2end/end2end_nosec_tests.c.template @@ -0,0 +1,4 @@ +%YAML 1.2 +--- | + <%namespace file="end2end_defs.include" import="*"/>\ + ${end2end_selector(k for k, v in core_end2end_tests.iteritems() if not v)} diff --git a/templates/test/core/end2end/end2end_tests.c.template b/templates/test/core/end2end/end2end_tests.c.template new file mode 100644 index 0000000000..e6a49f2795 --- /dev/null +++ b/templates/test/core/end2end/end2end_tests.c.template @@ -0,0 +1,4 @@ +%YAML 1.2 +--- | + <%namespace file="end2end_defs.include" import="*"/>\ + ${end2end_selector(core_end2end_tests.keys())} diff --git a/templates/test/core/surface/public_headers_must_be_c89.c.template b/templates/test/core/surface/public_headers_must_be_c89.c.template new file mode 100644 index 0000000000..e132256cb8 --- /dev/null +++ b/templates/test/core/surface/public_headers_must_be_c89.c.template @@ -0,0 +1,57 @@ +%YAML 1.2 +--- | + /* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + <% + def is_platform_header(hdr): + for platform_identifier in ['_gcc', '_win32', '_pthread', + '_zookeeper', '_msvc', '_posix']: + if platform_identifier in hdr: + return True + return False + hdrs = set() + pfx = 'include/' + for lib in libs: + if lib.language != 'c': continue + for hdr in lib.get('public_headers', []): + if is_platform_header(hdr): continue + assert(hdr[0:len(pfx)] == pfx) + hdrs.add(hdr[len(pfx):]) + hdrs = sorted(list(hdrs)) + %>\ + % for hdr in hdrs: + #include <${hdr}> + % endfor + + int main(int argc, char **argv) { return 0; } diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/sources_and_headers.json.template index 6f51ed7323..ba1c5a5ef8 100644 --- a/templates/tools/run_tests/sources_and_headers.json.template +++ b/templates/tools/run_tests/sources_and_headers.json.template @@ -31,5 +31,6 @@ tgt.get('headers', []) + proto_headers(tgt.src)), "deps": sorted(tgt.get('deps', []))} - for tgt in (targets + libs)], + for tgt in (targets + libs) + if not tgt.boringssl], sort_keys=True, indent=2)} diff --git a/templates/tools/run_tests/tests.json.template b/templates/tools/run_tests/tests.json.template index 655976ac86..3a3ac1e0f3 100644 --- a/templates/tools/run_tests/tests.json.template +++ b/templates/tools/run_tests/tests.json.template @@ -8,8 +8,10 @@ "language": tgt.language, "platforms": tgt.platforms, "ci_platforms": tgt.ci_platforms, - "exclude_configs": tgt.get("exclude_configs", []), + "exclude_configs": tgt.get("exclude_configs", []), + "args": [], "flaky": tgt.flaky} for tgt in targets - if tgt.get('run', True) and tgt.build == 'test'], + if tgt.get('run', True) and tgt.build == 'test'] + + tests, sort_keys=True, indent=2)} diff --git a/templates/vsprojects/buildtests_c.sln.template b/templates/vsprojects/buildtests_c.sln.template index eb314a3097..e9438bed22 100644 --- a/templates/vsprojects/buildtests_c.sln.template +++ b/templates/vsprojects/buildtests_c.sln.template @@ -2,6 +2,6 @@ --- | <%namespace file="sln_defs.include" import="gen_solution"/>\ <% - solution_projects = [p for p in vsprojects if p.build != 'protoc' and p.language in ['c', 'c++'] and not (p.language == 'c++' and p.build in ['private', 'test'])] + solution_projects = [p for p in vsprojects if p.build != 'protoc' and p.language == 'c' and not p.boringssl] %>\ ${gen_solution(solution_projects, use_dlls='yes')} diff --git a/templates/vsprojects/global.props.template b/templates/vsprojects/global.props.template index 5b8d1e1182..c53e4f16e3 100644 --- a/templates/vsprojects/global.props.template +++ b/templates/vsprojects/global.props.template @@ -13,6 +13,10 @@ <PreprocessorDefinitions>_WIN32_WINNT=0x600;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>EnableAllWarnings</WarningLevel> </ClCompile> + <Link> + <!-- LNK4271 pollutes test output. See #4521 --> + <AdditionalOptions>/ignore:4217 %(AdditionalOptions)</AdditionalOptions> + </Link> </ItemDefinitionGroup> <ItemGroup /> </Project> diff --git a/templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters.template b/templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters.template deleted file mode 100644 index 99f707ad41..0000000000 --- a/templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\ - ${gen_filters('grpc++_unsecure', libs)} diff --git a/templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.template b/templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.template deleted file mode 100644 index a6a7b2c108..0000000000 --- a/templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj_defs.include" import="gen_project"/>\ - ${gen_project('grpc++_unsecure', libs)} diff --git a/templates/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj.template b/templates/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj.template deleted file mode 100644 index 980bc589e4..0000000000 --- a/templates/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj_defs.include" import="gen_project"/>\ - ${gen_project('grpc_cpp_plugin', targets)} diff --git a/templates/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj.template b/templates/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj.template deleted file mode 100644 index 2c677d7f75..0000000000 --- a/templates/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj_defs.include" import="gen_project"/>\ - ${gen_project('grpc_csharp_plugin', targets)} diff --git a/templates/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj.template b/templates/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj.template deleted file mode 100644 index a31f3e383a..0000000000 --- a/templates/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj_defs.include" import="gen_project"/>\ - ${gen_project('grpc_objective_c_plugin', targets)} diff --git a/templates/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj.template b/templates/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj.template deleted file mode 100644 index c2ef396842..0000000000 --- a/templates/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj_defs.include" import="gen_project"/>\ - ${gen_project('grpc_python_plugin', targets)} diff --git a/templates/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj.template b/templates/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj.template deleted file mode 100644 index e7c094f5f9..0000000000 --- a/templates/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj.template +++ /dev/null @@ -1,4 +0,0 @@ -%YAML 1.2 ---- | - <%namespace file="../vcxproj_defs.include" import="gen_project"/>\ - ${gen_project('grpc_ruby_plugin', targets)} diff --git a/templates/vsprojects/vcxproj.filters_defs.include b/templates/vsprojects/vcxproj.filters_defs.include index d1ebb56709..7e2fbac147 100644 --- a/templates/vsprojects/vcxproj.filters_defs.include +++ b/templates/vsprojects/vcxproj.filters_defs.include @@ -5,7 +5,7 @@ def calc_to_filter(path): return '\\'.join(path.split('/')[:-1]) %>\ -<%def name="get_repo_root(proj)">${'..\..\..' + ('\..' if proj.vs_proj_dir != '.' else '')}</%def>\ +<%def name="get_repo_root(proj)">${'$(SolutionDir)\..'}</%def>\ <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ <%def name="to_filter(path)">${calc_to_filter(path)}</%def>\ <%def name="filter_to_guid(proj, filter)">${re.sub('(........)(....)(....)(....)', r'\1-\2-\3-\4-', hashlib.md5(''.join([filter, proj])).hexdigest())}</%def>\ @@ -62,4 +62,4 @@ </Project> % endif % endfor -</%def>\
\ No newline at end of file +</%def>\ diff --git a/templates/vsprojects/vcxproj_defs.include b/templates/vsprojects/vcxproj_defs.include index bbaef30fa6..b57c27f76a 100644 --- a/templates/vsprojects/vcxproj_defs.include +++ b/templates/vsprojects/vcxproj_defs.include @@ -1,6 +1,35 @@ <%namespace file="packages.include" import="gen_package_props,gen_package_targets,gen_package_ensure"/>\ <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ <%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}</%def>\ +<%def name="item_definition_group(project, target, debug, dll, _64bit)">\ + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='${'%s%s|%s' % ('Debug' if debug else 'Release', '-DLL' if dll else '', 'x64' if _64bit else 'Win32')}'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>${'Disabled' if debug else 'MaxSpeed'}</Optimization> + <PreprocessorDefinitions>WIN32;${'_DEBUG' if debug else 'NDEBUG'};_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> +% if not debug: + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> +% endif + <SDLCheck>true</SDLCheck> + <RuntimeLibrary>${'MultiThreadedDebug' if debug else 'MultiThreaded'}</RuntimeLibrary> + <TreatWarningAsError>${'false' if target.boringssl else 'true'}</TreatWarningAsError> + <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> +## Silence D9007 warning. See #4508 + <MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> + </ClCompile> + <Link> + <SubSystem>${get_subsystem(project.is_library)}</SubSystem> + <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> + <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> +% if not debug: + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> +% endif + </Link> + </ItemDefinitionGroup> +</%def>\ <%def name="gen_project(name, collection)">\ <% target = None @@ -21,19 +50,19 @@ props.extend(['protoc', 'protobuf']) else: if target.language == 'c++': - props.extend(['protobuf']) + props.extend(['protobuf']) props.extend(['winsock', 'zlib']) packages.extend(['grpc.dependencies.zlib']) if target.get('secure', 'check'): props.extend(['openssl']) - packages.extend(['grpc.dependencies.openssl']) + packages.extend(['grpc.dependencies.openssl']) else: props.extend(['winsock']) props.extend(['global']) props = sorted(list(set(props))) packages = sorted(list(set(packages))) dll = project.get('dll', False) - repo_root = '..\..\..' + ('\..' if project.vs_proj_dir != '.' else '') + repo_root = '$(SolutionDir)\..' %>\ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> @@ -76,6 +105,10 @@ ${gen_package_props(packages, repo_root)}\ </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>${project_guid if project_guid else project.vs_project_guid}</ProjectGuid> +## Silence MSB8029 warning. See #4506 + <IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> +## Use different location for intermediate directory to make path shorter than 260 characters. + <IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> @@ -132,165 +165,21 @@ ${gen_package_props(packages, repo_root)}\ % if package.get('linkage', None) is not None: <Linkage-${package.name.replace('.', '_')}>${package.linkage}</Linkage-${package.name.replace('.', '_')}> % endif - <Configuration-${package.name.replace('.', '_')}>Debug</Configuration-${package.name.replace('.', '_')}> + <Configuration-${package.name.replace('.', '_')}>${config}</Configuration-${package.name.replace('.', '_')}> % endif % endfor </PropertyGroup> % endfor - % if dll and dll != 'only': - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-DLL|Win32'"> - <ClCompile> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-DLL|x64'"> - <ClCompile> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-DLL|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-DLL|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - % endif - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader>NotUsing</PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <SDLCheck>true</SDLCheck> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - <TreatWarningAsError>true</TreatWarningAsError> - <DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> - </ClCompile> - <Link> - <SubSystem>${get_subsystem(project.is_library)}</SubSystem> - <GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> - <GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> +% if dll and dll != 'only': + ${item_definition_group(project, target, True, True, False)} + ${item_definition_group(project, target, True, True, True)} + ${item_definition_group(project, target, False, True, False)} + ${item_definition_group(project, target, False, True, True)} +% endif + ${item_definition_group(project, target, True, False, False)} + ${item_definition_group(project, target, True, False, True)} + ${item_definition_group(project, target, False, False, False)} + ${item_definition_group(project, target, False, False, True)} % if project.get('public_headers',[]): <ItemGroup> % for public_header in project.public_headers: |