mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[build] Also build sim modules as static libraries
This allows sim modules to be statically linked into an executable to create a "perfectly static" simulated desktop program. The entry point was changed to be unique when building static libraries to avoid symbol collisions.
This commit is contained in:
committed by
Peter Johnson
parent
0e702eb799
commit
2a09f6fa45
@@ -21,10 +21,15 @@ if (!project.hasProperty('onlylinuxathena')) {
|
||||
}
|
||||
}
|
||||
binaries.all {
|
||||
// Define a custom entry point if we are building statically to avoid symbol collision.
|
||||
if (it instanceof StaticLibraryBinarySpec) {
|
||||
it.buildable = false
|
||||
return
|
||||
// These scenario is seldom used, except in sysid to build a fully static exe
|
||||
// with simulation modules. When building static, it is important that no two
|
||||
// modules have the same entry point symbolically.
|
||||
def name = project.name.replace("halsim_", "").toUpperCase()
|
||||
it.cppCompiler.define("HALSIM_InitExtension", "HALSIM_InitExtension_$name")
|
||||
}
|
||||
|
||||
project(':hal').addHalDependency(it, 'shared')
|
||||
if (project.hasProperty('includeNtCore')) {
|
||||
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
|
||||
|
||||
Reference in New Issue
Block a user