[skip ci]
This commit is contained in:
alexey.lysiuk 2023-04-16 10:36:43 +03:00
parent 46f6b696c3
commit 53c454e87f
3 changed files with 13 additions and 3 deletions

View File

@ -45,6 +45,7 @@ class Builder(object):
state = self._state = BuildState()
state.xcode = arguments.xcode
state.instrument_functions = arguments.instrument_functions
state.verbose = arguments.verbose
self._platforms: typing.List[TargetPlatform] = []
@ -336,6 +337,7 @@ class Builder(object):
group = parser.add_argument_group('Configuration options')
group.add_argument('--xcode', action='store_true', help='generate Xcode project instead of build')
group.add_argument('--instrument-functions', action='store_true', help='generate instrumentation calls')
group.add_argument('--os-version-x64', metavar='version', help='macOS deployment version for x86_64')
group.add_argument('--os-version-arm', metavar='version', help='macOS deployment version for ARM64')
group.add_argument('--verbose', action='store_true', help='enable verbose build output')

View File

@ -53,6 +53,7 @@ class BuildState:
self.platform = None
self.xcode = False
self.instrument_functions = False
self.verbose = False
self.jobs = 1

View File

@ -383,11 +383,18 @@ class CMakeTarget(BuildTarget):
def configure(self, state: BuildState):
super().configure(state)
if state.instrument_functions:
build_type = 'RelWithDebInfo'
extra_flags = '-finstrument-functions'
else:
build_type = 'Release'
extra_flags = ''
args = [
'cmake',
'-DCMAKE_BUILD_TYPE=Release',
f'-DCMAKE_C_FLAGS="-ffile-prefix-map={state.source}/="',
f'-DCMAKE_CXX_FLAGS="-ffile-prefix-map={state.source}/="',
f'-DCMAKE_BUILD_TYPE={build_type}',
f'-DCMAKE_C_FLAGS="-ffile-prefix-map={state.source}/=" {extra_flags}',
f'-DCMAKE_CXX_FLAGS="-ffile-prefix-map={state.source}/=" {extra_flags}',
f'-DCMAKE_INSTALL_PREFIX={state.install_path}',
f'-DCMAKE_PREFIX_PATH={state.prefix_path}',
]