Select the default platform depending of the target.
Default platform `android` is better for `kiwix-android` (because `kiwix-android` can build only on `android` platform).
This commit is contained in:
parent
5f5fbfe082
commit
cfdf03c854
|
@ -71,8 +71,10 @@ By default, `kiwix-build` will build `kiwix-tools` .
|
||||||
|
|
||||||
## Target platform
|
## Target platform
|
||||||
|
|
||||||
By default, `kiwix-build` will build everything for the current (native)
|
If no target platform is specified, a default one will be infered from
|
||||||
platform using dynamic linkage (`native_dyn`).
|
the specified target :
|
||||||
|
- `kiwix-android` will be build using the platform `android`
|
||||||
|
- Other targets will be build using the platform `native_dyn`
|
||||||
|
|
||||||
But you can select another target platform using the option
|
But you can select another target platform using the option
|
||||||
`--target-platform`. For now, there is ten different supported
|
`--target-platform`. For now, there is ten different supported
|
||||||
|
|
|
@ -14,7 +14,7 @@ def parse_args():
|
||||||
choices=Dependency.all_deps.keys())
|
choices=Dependency.all_deps.keys())
|
||||||
parser.add_argument('--working-dir', default=".")
|
parser.add_argument('--working-dir', default=".")
|
||||||
parser.add_argument('--libprefix', default=None)
|
parser.add_argument('--libprefix', default=None)
|
||||||
parser.add_argument('--target-platform', default="native_dyn", choices=PlatformInfo.all_platforms)
|
parser.add_argument('--target-platform', choices=PlatformInfo.all_platforms)
|
||||||
parser.add_argument('--verbose', '-v', action="store_true",
|
parser.add_argument('--verbose', '-v', action="store_true",
|
||||||
help=("Print all logs on stdout instead of in specific"
|
help=("Print all logs on stdout instead of in specific"
|
||||||
" log files per commands"))
|
" log files per commands"))
|
||||||
|
|
|
@ -17,7 +17,13 @@ class Builder:
|
||||||
self._targets = {}
|
self._targets = {}
|
||||||
PlatformInfo.get_platform('neutral', self._targets)
|
PlatformInfo.get_platform('neutral', self._targets)
|
||||||
|
|
||||||
platform = PlatformInfo.get_platform(option('target_platform'), self._targets)
|
target_platform = option('target_platform')
|
||||||
|
if not target_platform:
|
||||||
|
if option('target') == 'kiwix-android':
|
||||||
|
target_platform = 'android'
|
||||||
|
else:
|
||||||
|
target_platform = 'native_dyn'
|
||||||
|
platform = PlatformInfo.get_platform(target_platform, self._targets)
|
||||||
self.targetDefs = platform.add_targets(option('target'), self._targets)
|
self.targetDefs = platform.add_targets(option('target'), self._targets)
|
||||||
|
|
||||||
def finalize_target_steps(self):
|
def finalize_target_steps(self):
|
||||||
|
|
Loading…
Reference in New Issue