Factor out versioning.
This commit is contained in:
parent
4159e1a177
commit
db14d2d00a
@ -275,8 +275,7 @@ class SMConfig(object):
|
|||||||
cxx.includes += [os.path.join(builder.buildPath, 'includes')]
|
cxx.includes += [os.path.join(builder.buildPath, 'includes')]
|
||||||
cxx.includes += [os.path.join(builder.sourcePath, 'versionlib')]
|
cxx.includes += [os.path.join(builder.sourcePath, 'versionlib')]
|
||||||
|
|
||||||
def LibraryBuilder(self, compiler, name):
|
def AddVersioning(self, binary):
|
||||||
binary = compiler.Library(name)
|
|
||||||
if builder.target_platform == 'windows':
|
if builder.target_platform == 'windows':
|
||||||
binary.sources += ['version.rc']
|
binary.sources += ['version.rc']
|
||||||
binary.compiler.rcdefines += [
|
binary.compiler.rcdefines += [
|
||||||
@ -285,30 +284,23 @@ class SMConfig(object):
|
|||||||
]
|
]
|
||||||
if self.use_auto_versioning():
|
if self.use_auto_versioning():
|
||||||
binary.compiler.rcdefines += ['SM_GENERATED_BUILD']
|
binary.compiler.rcdefines += ['SM_GENERATED_BUILD']
|
||||||
elif builder.target_platform == 'mac':
|
|
||||||
binary.compiler.postlink += [
|
|
||||||
'-compatibility_version', '1.0.0',
|
|
||||||
'-current_version', self.productVersion
|
|
||||||
]
|
|
||||||
if self.use_auto_versioning():
|
if self.use_auto_versioning():
|
||||||
binary.compiler.linkflags += [self.versionlib]
|
binary.compiler.linkflags += [self.versionlib]
|
||||||
binary.compiler.sourcedeps += SM.generated_headers
|
binary.compiler.sourcedeps += SM.generated_headers
|
||||||
return binary
|
return binary
|
||||||
|
|
||||||
|
def LibraryBuilder(self, compiler, name):
|
||||||
|
binary = compiler.Library(name)
|
||||||
|
if builder.target_platform == 'mac':
|
||||||
|
binary.compiler.postlink += [
|
||||||
|
'-compatibility_version', '1.0.0',
|
||||||
|
'-current_version', self.productVersion
|
||||||
|
]
|
||||||
|
return self.AddVersioning(self, binary)
|
||||||
|
|
||||||
def ProgramBuilder(self, compiler, name):
|
def ProgramBuilder(self, compiler, name):
|
||||||
binary = compiler.Program(name)
|
binary = compiler.Program(name)
|
||||||
if builder.target_platform == 'windows':
|
return self.AddVersioning(binary)
|
||||||
binary.sources += ['version.rc']
|
|
||||||
binary.compiler.rcdefines += [
|
|
||||||
'BINARY_NAME="{0}"'.format(binary.outputFile),
|
|
||||||
'RC_COMPILE',
|
|
||||||
]
|
|
||||||
if self.use_auto_versioning():
|
|
||||||
binary.compiler.rcdefines += ['SM_GENERATED_BUILD']
|
|
||||||
if self.use_auto_versioning():
|
|
||||||
binary.compiler.linkflags += [self.versionlib]
|
|
||||||
binary.compiler.sourcedeps += SM.generated_headers
|
|
||||||
return binary
|
|
||||||
|
|
||||||
def Library(self, context, name):
|
def Library(self, context, name):
|
||||||
compiler = context.compiler.clone()
|
compiler = context.compiler.clone()
|
||||||
|
Loading…
Reference in New Issue
Block a user