Skip to content

Commit 97d1511

Browse files
committed
Merge branch 'trunk'
Change-Id: I28707019b7bfab5a2c4af19e95525b3c42af2f8c
2 parents 086e926 + a0cd072 commit 97d1511

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2807
-2391
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
2525
option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON)
2626
option(BUILD_WSI_XLIB_SUPPORT "Build Xlib WSI support" ON)
2727
option(BUILD_WSI_WAYLAND_SUPPORT "Build Wayland WSI support" ON)
28-
option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" ON)
28+
option(BUILD_WSI_MIR_SUPPORT "Build Mir WSI support" OFF)
2929
set(DEMOS_WSI_SELECTION "XCB" CACHE STRING "Select WSI target for demos (XCB, XLIB, WAYLAND, MIR, DISPLAY)")
3030

3131
if (BUILD_WSI_XCB_SUPPORT)

build-android/build_all.sh

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 The Android Open Source Project
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
if [ -z "${ANDROID_SDK_HOME}" ];
18+
then echo "Please set ANDROID_SDK_HOME, exiting"; exit 1;
19+
else echo "ANDROID_SDK_HOME is ${ANDROID_SDK_HOME}";
20+
fi
21+
22+
if [ -z "${ANDROID_NDK_HOME}" ];
23+
then echo "Please set ANDROID_NDK_HOME, exiting"; exit 1;
24+
else echo "ANDROID_NDK_HOME is ${ANDROID_NDK_HOME}";
25+
fi
26+
27+
if [[ $(uname) == "Linux" ]]; then
28+
cores=$(nproc) || echo 4
29+
elif [[ $(uname) == "Darwin" ]]; then
30+
cores=$(sysctl -n hw.ncpu) || echo 4
31+
fi
32+
33+
function findtool() {
34+
if [[ ! $(type -t $1) ]]; then
35+
echo Command $1 not found, see ../BUILD.md;
36+
exit 1;
37+
fi
38+
}
39+
40+
# Check for dependencies
41+
findtool aapt
42+
findtool zipalign
43+
findtool jarsigner
44+
45+
set -ev
46+
47+
LAYER_BUILD_DIR=$PWD
48+
DEMO_BUILD_DIR=$PWD/../demos/android
49+
echo LAYER_BUILD_DIR="${LAYER_BUILD_DIR}"
50+
echo DEMO_BUILD_DIR="${DEMO_BUILD_DIR}"
51+
52+
function create_APK() {
53+
aapt package -f -M AndroidManifest.xml -I "$ANDROID_SDK_HOME/platforms/android-23/android.jar" -S res -F bin/$1-unaligned.apk bin/libs
54+
# update this logic to detect if key is already there. If so, use it, otherwise create it.
55+
jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android bin/$1-unaligned.apk androiddebugkey
56+
zipalign -f 4 bin/$1-unaligned.apk bin/$1.apk
57+
}
58+
59+
#
60+
# build layers
61+
#
62+
./update_external_sources_android.sh
63+
./android-generate.sh
64+
ndk-build -j $cores
65+
66+
#
67+
# build VulkanLayerValidationTests APK
68+
#
69+
mkdir -p bin/libs/lib
70+
cp -r $LAYER_BUILD_DIR/libs/* $LAYER_BUILD_DIR/bin/libs/lib/
71+
create_APK VulkanLayerValidationTests
72+
73+
#
74+
# build cube APKs (with and without layers)
75+
#
76+
(
77+
pushd $DEMO_BUILD_DIR
78+
ndk-build -j $cores
79+
# Package one APK without validation layers
80+
mkdir -p $DEMO_BUILD_DIR/cube/bin/libs/lib
81+
cp -r $DEMO_BUILD_DIR/libs/* $DEMO_BUILD_DIR/cube/bin/libs/lib/
82+
cd $DEMO_BUILD_DIR/cube
83+
create_APK cube
84+
# And one with validation layers
85+
mkdir -p $DEMO_BUILD_DIR/cube-with-layers/bin/libs/lib
86+
cp -r $DEMO_BUILD_DIR/libs/* $DEMO_BUILD_DIR/cube-with-layers/bin/libs/lib/
87+
cp -r $LAYER_BUILD_DIR/libs/* $DEMO_BUILD_DIR/cube-with-layers/bin/libs/lib/
88+
cd $DEMO_BUILD_DIR/cube-with-layers
89+
create_APK cube-with-layers
90+
popd
91+
)
92+
93+
#
94+
# build Smoke with layers
95+
#
96+
# TODO
97+
98+
echo Builds succeeded
99+
exit 0

build-android/install_all.sh

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/bash
2+
3+
# Copyright 2017 The Android Open Source Project
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
#
20+
# Parse parameters
21+
#
22+
23+
function printUsage {
24+
echo "Supported parameters are:"
25+
echo " -s|--serial <target device serial number> (optional)"
26+
echo
27+
echo "i.e. ${0##*/} -s <serial number>"
28+
exit 1
29+
}
30+
31+
if [[ $(($# % 2)) -ne 0 ]]
32+
then
33+
echo Parameters must be provided in pairs.
34+
echo parameter count = $#
35+
echo
36+
printUsage
37+
exit 1
38+
fi
39+
40+
while [[ $# -gt 0 ]]
41+
do
42+
case $1 in
43+
-s|--serial)
44+
# include the flag, because we need to leave it off if not provided
45+
serial="$2"
46+
shift 2
47+
;;
48+
-*)
49+
# unknown option
50+
echo Unknown option: $1
51+
echo
52+
printUsage
53+
exit 1
54+
;;
55+
esac
56+
done
57+
58+
if [[ $serial ]]; then
59+
echo serial = "${serial}"
60+
serialFlag="-s $serial"
61+
if [[ $(adb devices) != *"$serial"* ]]
62+
then
63+
echo Device not found: "${serial}"
64+
echo
65+
printUsage
66+
exit 1
67+
fi
68+
else
69+
echo Using device $(adb get-serialno)
70+
fi
71+
72+
# Install everything built by build_all.sh
73+
echo "adb $serialFlag install -r bin/VulkanLayerValidationTests.apk"
74+
adb $serialFlag install -r bin/VulkanLayerValidationTests.apk
75+
echo "adb $serialFlag install -r ../demos/android/cube/bin/cube.apk"
76+
adb $serialFlag install -r ../demos/android/cube/bin/cube.apk
77+
echo "adb $serialFlag install -r ../demos/android/cube-with-layers/bin/cube-with-layers.apk"
78+
adb $serialFlag install -r ../demos/android/cube-with-layers/bin/cube-with-layers.apk
79+
80+
exit $?

0 commit comments

Comments
 (0)