aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2016-01-12 08:54:01 -0800
committerGravatar Jan Tattermusch <jtattermusch@google.com>2016-01-12 11:26:41 -0800
commit324140c2e9b4b10bc4b19dc30043a60ed051ed26 (patch)
tree816904f12540537684fbbd973df3f5891f8625a7
parent2eeae979d88ef1d03e070efa2d3fcefa7c678a93 (diff)
support static linkage for dependencies
-rw-r--r--build.yaml3
-rw-r--r--templates/Makefile.template17
2 files changed, 14 insertions, 6 deletions
diff --git a/build.yaml b/build.yaml
index e513f0daf7..740e751af3 100644
--- a/build.yaml
+++ b/build.yaml
@@ -797,8 +797,9 @@ libs:
src:
- src/csharp/ext/grpc_csharp_ext.c
deps:
- - gpr
- grpc
+ - gpr
+ deps_linkage: static
dll: only
vs_config_type: DynamicLibrary
vs_packages:
diff --git a/templates/Makefile.template b/templates/Makefile.template
index ba5a80659c..43ce6c5794 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -1645,11 +1645,18 @@
if lib.language == 'c++':
lib_deps += ' $(PROTOBUF_DEP)'
mingw_lib_deps += ' $(PROTOBUF_DEP)'
- for dep in lib.get('deps', []):
- libs = libs + ' -l' + dep
- lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
- mingw_libs = mingw_libs + ' -l' + dep + '-imp'
- mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT)'
+ if lib.get('deps_linkage', None) == 'static':
+ for dep in lib.get('deps', []):
+ lib_archive = '$(LIBDIR)/$(CONFIG)/lib' + dep + '.a'
+ common = common + ' ' + lib_archive
+ lib_deps = lib_deps + ' ' + lib_archive
+ mingw_lib_deps = mingw_lib_deps + ' ' + lib_archive
+ else:
+ for dep in lib.get('deps', []):
+ libs = libs + ' -l' + dep
+ lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT)'
+ mingw_libs = mingw_libs + ' -l' + dep + '-imp'
+ mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT)'
security = lib.get('secure', 'check')
if security == True: