summary refs log tree commit diff
path: root/build_test.py
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-03-09 03:02:23 +0000
committerAlyssa Ross <hi@alyssa.is>2020-03-09 03:02:23 +0000
commit1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2 (patch)
tree0f44cc95b797eb50f78bf4246bdeb908f5981d7e /build_test.py
parentda70e9a5c947c0fef40479cc99ae13f52b4e1065 (diff)
parent9515b05c086c55b9e3fbddbc56fb6eb3e9a510a8 (diff)
downloadcrosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.tar
crosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.tar.gz
crosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.tar.bz2
crosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.tar.lz
crosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.tar.xz
crosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.tar.zst
crosvm-1fb99239c0e5976cbad2fa8fdc45f15d219f7ed2.zip
Merge remote-tracking branch 'origin/master' into master
Diffstat (limited to 'build_test.py')
-rwxr-xr-xbuild_test.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/build_test.py b/build_test.py
index 93bd3cd..4745138 100755
--- a/build_test.py
+++ b/build_test.py
@@ -160,10 +160,20 @@ def check_build(sysroot, triple, kind, test_it, clean):
 
   is_release = kind == 'release'
 
+  # The pkgconfig dir could be in either lib or lib64 depending on the target.
+  # Rather than checking to see which one is valid, just add both and let
+  # pkg-config search.
+  libdir = os.path.join(sysroot, 'usr', 'lib', 'pkgconfig')
+  lib64dir = os.path.join(sysroot, 'usr', 'lib64', 'pkgconfig')
+
   env = os.environ.copy()
   env['TARGET_CC'] = '%s-clang'%triple
   env['SYSROOT'] = sysroot
   env['CARGO_TARGET_DIR'] = target_path
+  env['PKG_CONFIG_ALLOW_CROSS'] = '1'
+  env['PKG_CONFIG_LIBDIR'] = libdir + ':' + lib64dir
+  env['PKG_CONFIG_SYSROOT_DIR'] = sysroot
+  env['RUSTFLAGS'] = '-C linker=' + env['TARGET_CC']
 
   if test_it:
     if not test_target(triple, is_release, env):