Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
Link zlib with test. Fixed tests target.
Browse files Browse the repository at this point in the history
  • Loading branch information
juvinious committed Aug 18, 2017
1 parent 8360486 commit 4ba00a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
33 changes: 5 additions & 28 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import sys

Import('root')

#print "Rtech1 sys path", Dir('.').rel_path(Dir("#%s" % root))
#print Dir('.').abspath
#print Dir(Dir('.').rel_path(Dir("#r-tech1"))).abspath
sys.path.append(Dir('.').rel_path(Dir("#%s" % root)))

import scons_rtech1.utils
Expand Down Expand Up @@ -63,7 +60,7 @@ Alias('rtech1', rtech1)

tests_build_dir = os.path.join(build_dir, 'tests')
unit_tests = []
if not scons_rtech1.utils.useAndroid() and False:
if not scons_rtech1.utils.useAndroid():
unit_tests = SConscript('tests/SConscript', variant_dir = tests_build_dir, exports = ['env', 'rtech1', 'root'], duplicate=0)
env.Depends(unit_tests, rtech1)

Expand All @@ -77,9 +74,6 @@ if os.access(env.installPrefix, os.W_OK):
include_dir = 'include/r-tech1'
for root, dirs, files in os.walk(include_dir):
for file in files:
# print "Install %s, %s" % (header_prefix + root[len('include/r-tech1'):], os.path.join(root, file))
# Install to <header location>/<local subdirectory>. The root contains the full
# include/r-tech1/subdirectory, so we chop off the leading include/r-tech1
installEnv.Install(header_prefix + root[len(include_dir):], os.path.join(root, file))

installEnv.Install(os.path.join(header_prefix, 'lz4'), 'src/libs/lz4/lz4.h')
Expand All @@ -101,35 +95,17 @@ else:
env.Command('uninstall', None, needsudo)
env.Depends('uninstall', ['rtech1', 'tests'])

#env.Install('headers', Dir('include', Dir('.').rel_path(Dir("#%s" % root))).abspath)
#env.Install('headers/include/lz4', File('src/libs/lz4/lz4.h', Dir('.').rel_path(Dir('#%s' % root))).abspath)

#env.Install(os.path.join(build_dir, 'headers'), Dir('include', Dir('.').rel_path(Dir("#%s" % root))).abspath)
#env['RTECH1_HEADERS'] = Dir('headers', Dir(build_dir))

include_dir = 'include/r-tech1'
root_dir = Dir('include/r-tech1', Dir('#%s' % root)).abspath
for myroot, dirs, files in os.walk(root_dir):
for file in files:
source = os.path.join(myroot, file)
dir = myroot[len(root_dir) + 1:]
# print "Stripped %s" % os.path.join(source[len(root_dir) + 1:])
# print Dir('headers/r-tech1', Dir(build_dir)).abspath
destination = Dir(dir, Dir('headers/r-tech1', Dir(build_dir))).abspath
# print "Install %s -> %s" % (source, destination)
# Install to <header location>/<local subdirectory>. The root contains the full
# include/r-tech1/subdirectory, so we chop off the leading include/r-tech1
# env.Install(os.path.join(build_dir, 'headers/r-tech1', root[len(include_dir):]), File(os.path.join(root, file), Dir('.').rel_path(Dir('#%s' % root))).abspath)
# env.Install(destination, File(source, Dir('.').rel_path('#%s' % root)).abspath)
# env.Install(destination, File(source))

# env.Install(os.path.join(build_dir, 'headers/r-tech1/lz4'), File('src/libs/lz4/lz4.h', Dir('.').rel_path(Dir('#%s' % root))).abspath)

# env['RTECH1_HEADERS'] = [Dir('include', Dir('.').rel_path(Dir('#%s' % root))).abspath, Dir('headers', Dir(build_dir))]

env['RTECH1_HEADERS'] = [Dir('include', Dir('.').rel_path(Dir('#%s' % root))).abspath]
# env['RTECH1_HEADERS'] = [Dir('headers', Dir(build_dir))]

# env.Default(rtech1)
# Unit tests
env.Alias('tests', unit_tests)

for test in unit_tests:
Expand All @@ -138,6 +114,7 @@ for test in unit_tests:
#print orig, to
copy = Command('bin/{0}'.format(to), orig, Copy('$TARGET', '$SOURCE'))
env.Depends(copy, test)
env.Alias('tests', copy)
env.AlwaysBuild(copy)
env.Alias('tests', copy, copy[0].abspath)

Return('rtech1')
3 changes: 2 additions & 1 deletion tests/init/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ try:
except:
use['LIBS'].append(rtech1)
use['LIBS'].append(env['LIBS'])
pass
use.ParseConfig('pkg-config zlib --libs --cflags')

init_test = use.Program('init-test', 'main.cpp')

Return('init_test')

0 comments on commit 4ba00a6

Please sign in to comment.