-
Notifications
You must be signed in to change notification settings - Fork 4
/
overrides.rb
51 lines (45 loc) · 1.67 KB
/
overrides.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
if Autoproj.user_config('DEB_USE')
# Setup of the TYPELIB_PLUGIN_PATH
typelib_plugin_path = nil
if defined?(Autobuild.environment)
typelib_plugin_path = Autobuild.environment['TYPELIB_PLUGIN_PATH']
else
typelib_plugin_path = Autobuild.env.environment['TYPELIB_PLUGIN_PATH']
end
# Make sure the release path to typelib is used, when there is no local
# installation
require_relative 'lib/rock-osdeps/release'
main_release = Autoproj.user_config('debian_release')
release = Rock::DebianPackaging::Release.new(main_release,
data_dir: File.join(__dir__,'data'))
release.hierarchy.each do |release|
release_dir="/opt/rock/#{release}"
typelibdir = File.join(release_dir, 'lib','typelib')
if !Dir[typelibdir + "/*"].empty?
Autoproj.env_set_path 'TYPELIB_PLUGIN_PATH', File.join(release_dir, 'lib','typelib')
end
end
end
deb_cxx_flags = []
deb_cxx_flags << "-std=c++11"
Autobuild::Package.each do |name, pkg|
if pkg.respond_to?(:define)
existing_cxx_flags=pkg.defines['CMAKE_CXX_FLAGS']
if existing_cxx_flags
existing_cxx_flags = existing_cxx_flags.split(" ")
else
existing_cxx_flags = []
end
extra_cxx_flags = Array.new
deb_cxx_flags.each do |flag|
if existing_cxx_flags.include?(flag)
existing_cxx_flags.delete(flag)
end
end
cxx_flags = deb_cxx_flags + existing_cxx_flags
cxx_flags = cxx_flags.join(" ")
if !cxx_flags.empty?
pkg.define "CMAKE_CXX_FLAGS", cxx_flags
end
end
end