mirror of
https://github.com/microsoft/GSL.git
synced 2025-04-01 08:56:29 -04:00
Compare commits
2 Commits
b39e7e4b09
...
3275f9ccb9
Author | SHA1 | Date | |
---|---|---|---|
|
3275f9ccb9 | ||
|
b206bd163b |
23
.github/workflows/android.yml
vendored
23
.github/workflows/android.yml
vendored
@ -1,4 +1,9 @@
|
|||||||
name: CI_Android
|
name: CI_Android
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
@ -7,7 +12,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Android:
|
Android:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest-large
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: build
|
working-directory: build
|
||||||
@ -18,15 +23,19 @@ jobs:
|
|||||||
run: mkdir -p build
|
run: mkdir -p build
|
||||||
working-directory: .
|
working-directory: .
|
||||||
|
|
||||||
- name: Start emulator
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
java-version: 8
|
||||||
|
distribution: zulu
|
||||||
|
|
||||||
|
- name: Start Emulator
|
||||||
run: |
|
run: |
|
||||||
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-24;default;x86_64'
|
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-24;default;x86_64'
|
||||||
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-24;default;x86_64' --force
|
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n xamarin_android_emulator -k 'system-images;android-24;default;x86_64' --force
|
||||||
$ANDROID_HOME/emulator/emulator -list-avds
|
$ANDROID_HOME/emulator/emulator -list-avds
|
||||||
echo "Starting emulator"
|
echo "Starting emulator..."
|
||||||
# Start emulator in background
|
nohup $ANDROID_HOME/emulator/emulator -no-audio -no-snapshot -avd xamarin_android_emulator &> /dev/null &
|
||||||
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot > /dev/null 2>&1 &
|
echo "Emulator starting in background"
|
||||||
echo "Emulator starting"
|
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: cmake -Werror=dev -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=16 -DANDROID_ABI=x86_64 -DCMAKE_BUILD_TYPE=Debug ..
|
run: cmake -Werror=dev -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_PLATFORM=16 -DANDROID_ABI=x86_64 -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
@ -35,11 +44,11 @@ jobs:
|
|||||||
run: cmake --build . --parallel
|
run: cmake --build . --parallel
|
||||||
|
|
||||||
- name: Wait for emulator ready
|
- name: Wait for emulator ready
|
||||||
|
timeout-minutes: 2
|
||||||
run: |
|
run: |
|
||||||
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 10; done; input keyevent 82'
|
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 10; done; input keyevent 82'
|
||||||
$ANDROID_HOME/platform-tools/adb devices
|
$ANDROID_HOME/platform-tools/adb devices
|
||||||
$ANDROID_HOME/platform-tools/adb shell getprop ro.product.cpu.abi
|
$ANDROID_HOME/platform-tools/adb shell getprop ro.product.cpu.abi
|
||||||
echo "Emulator started"
|
|
||||||
|
|
||||||
- name: Deploy tests
|
- name: Deploy tests
|
||||||
run: |
|
run: |
|
||||||
|
@ -64,10 +64,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
|
// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
|
||||||
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
|
#if defined(__clang__)
|
||||||
|
#if __has_warning("-Wunsafe-buffer-usage")
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
||||||
#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
|
#endif // __has_warning("-Wunsafe-buffer-usage")
|
||||||
|
#endif // defined(__clang__)
|
||||||
|
|
||||||
namespace gsl
|
namespace gsl
|
||||||
{
|
{
|
||||||
@ -852,8 +854,10 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif // __GNUC__ > 6
|
#endif // __GNUC__ > 6
|
||||||
|
|
||||||
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
|
#if defined(__clang__)
|
||||||
|
#if __has_warning("-Wunsafe-buffer-usage")
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif // __has_warning("-Wunsafe-buffer-usage")
|
||||||
|
#endif // defined(__clang__)
|
||||||
|
|
||||||
#endif // GSL_SPAN_H
|
#endif // GSL_SPAN_H
|
||||||
|
@ -41,10 +41,12 @@
|
|||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
|
// Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks
|
||||||
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
|
#if defined(__clang__)
|
||||||
|
#if __has_warning("-Wunsafe-buffer-usage")
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
|
||||||
#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
|
#endif // __has_warning("-Wunsafe-buffer-usage")
|
||||||
|
#endif // defined(__clang__)
|
||||||
|
|
||||||
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
#if defined(__cplusplus) && (__cplusplus >= 201703L)
|
||||||
#define GSL_NODISCARD [[nodiscard]]
|
#define GSL_NODISCARD [[nodiscard]]
|
||||||
@ -160,8 +162,10 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size
|
|||||||
|
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage")
|
#if defined(__clang__)
|
||||||
|
#if __has_warning("-Wunsafe-buffer-usage")
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif // __has_warning("-Wunsafe-buffer-usage")
|
||||||
|
#endif // defined(__clang__)
|
||||||
|
|
||||||
#endif // GSL_UTIL_H
|
#endif // GSL_UTIL_H
|
||||||
|
@ -146,6 +146,7 @@ else()
|
|||||||
-Wno-global-constructors # GTest
|
-Wno-global-constructors # GTest
|
||||||
-Wno-missing-prototypes
|
-Wno-missing-prototypes
|
||||||
-Wno-padded
|
-Wno-padded
|
||||||
|
-Wno-switch-default
|
||||||
-Wno-unknown-attributes
|
-Wno-unknown-attributes
|
||||||
-Wno-used-but-marked-unused # GTest EXPECT_DEATH
|
-Wno-used-but-marked-unused # GTest EXPECT_DEATH
|
||||||
-Wno-weak-vtables
|
-Wno-weak-vtables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user