build: Allow compilation as a shared library
This commit introduces --enable-static, --disable-static,
--enable-shared, and --disable-shared to enable/disable compilation of
static and shared library versions (by default, only a static library is
enabled).
Building of both static and shared library versions results in
compilation of every source file twice: with and without PIC flag.
Change-Id: I64c6dc736c249b93b0c64cad15249f3b3f242c25
Refs: #2243
diff --git a/.waf-tools/pch.py b/.waf-tools/pch.py
index 3df299f..57582ad 100644
--- a/.waf-tools/pch.py
+++ b/.waf-tools/pch.py
@@ -95,8 +95,8 @@
if getattr(self, 'name', None):
try:
- task = self.bld.pch_tasks[self.name]
- self.bld.fatal("Duplicated 'pch' task with name %r" % self.name)
+ task = self.bld.pch_tasks["%s.%s" % (self.name, self.idx)]
+ self.bld.fatal("Duplicated 'pch' task with name %r" % "%s.%s" % (self.name, self.idx))
except KeyError:
pass
@@ -109,7 +109,7 @@
self.pch_task = task
if getattr(self, 'name', None):
- self.bld.pch_tasks[self.name] = task
+ self.bld.pch_tasks["%s.%s" % (self.name, self.idx)] = task
@TaskGen.feature('cxx')
@TaskGen.after_method('process_source', 'propagate_uselib_vars')