Skip to content

Commit

Permalink
Add tools.scons
Browse files Browse the repository at this point in the history
Add tools.scons
  • Loading branch information
kbernhagen committed Oct 30, 2023
1 parent ac01ec0 commit ad04f19
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*.app

# Build byproducts
/bin
/build
/package.txt
/package-description.txt
Expand Down
10 changes: 9 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,19 @@ if env['PLATFORM'] == 'win32' or int(env.get('cross_mingw', 0)):
duplicate = 0)
Default(hide_console)

tools = SConscript('src/tools.scons', variant_dir = 'build', duplicate = 0)
for tool in tools:
Default(tool)
Depends(tool, client)
# Clean
Clean(client, ['build', 'config.log'])
Clean(client, ['bin', 'build', 'config.log'])

# Dist
docs = ['README.md', 'CHANGELOG.md', 'LICENSE']
distfiles = docs + [client, 'images/fahlogo.png']
if env['PLATFORM'] == 'posix':
distfiles.append('install/lin/fah-client.service')
distfiles += tools
if hide_console is not None: distfiles.append(hide_console)
tar = env.TarBZ2Dist('fah-client', distfiles)
Alias('dist', tar)
Expand Down Expand Up @@ -130,6 +135,9 @@ if 'package' in COMMAND_LINE_TARGETS:
['build/install/osx/launchd.plist',
'Library/LaunchDaemons/' +
'org.foldingathome.fahclient.plist', 0o644]]
for tool in tools:
pkg_files += [[str(tool[0]), 'usr/local/bin/', 0o755]]

pkg_components = [
{
# name is component pkg file name and name shown in installer
Expand Down
19 changes: 19 additions & 0 deletions src/tools.scons
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Import('*')

tools_scons = Glob('all-*.scons')

if env['PLATFORM'] == 'win32' or int(env.get('cross_mingw', 0)):
tools_scons += Glob('win-*.scons')
elif env['PLATFORM'] == 'darwin':
tools_scons += Glob('osx-*.scons')
else:
tools_scons += Glob('lin-*.scons')

Export('env')

tools = []
for tscons in tools_scons:
tool = SConscript(tscons, variant_dir = '#/build', duplicate = 0)
if tool: tools += [tool]

Return('tools')

0 comments on commit ad04f19

Please sign in to comment.