libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.97k stars 1.84k forks source link

SDL2 for Android ARM64 with CMake / android.toolchain.cmake / Visual Studio 17 2022 #5278

Closed aquawicket closed 2 years ago

aquawicket commented 2 years ago

Having issues compiling SDL2 for Android arm64-v8a using CMake / android.toolchain.cmake / Visual Studio 17 2022 This same setup compiles and runs fine for armeabi-v7a and the Preprocessor __arm__ is defined and working in SDL_spinlock.c but not for arm64-v8a, which is A64 Anyone know what I'm missing to get this working.

cmake -G Visual Studio 17 2022 -A ARM64 
    -DBUILD_SHARED_LIBS=OFF 
    -DBUILD_STATIC_LIBS=ON 
    -DANDROID_PLATFORM=26 
    -DANDROID_NDK=C:/android-sdk/ndk/22.1.7171670 
    -DCMAKE_TOOLCHAIN_FILE=C:/android-sdk/ndk/22.1.7171670/build/cmake/android.toolchain.cmake 
    -DANDROID_TOOLCHAIN=clang 
    -DANDROID_ABI=arm64-v8a 
    -DANDROID_STL=c++_static 
    -DCMAKE_C_FLAGS="-DANDROID -DANDROID64 -std=c17"
    -DCMAKE_CXX_FLAGS="-DANDROID -DANDROID64"
    -DCMAKE_C_FLAGS_DEBUG="-DDEBUG -D_DEBUG -g" 
    -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG -DRELEASE -O3" 
    -DCMAKE_CXX_FLAGS_DEBUG="-DDEBUG -D_DEBUG -g"
    -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -DRELEASE -O3" 
    -DLIBTYPE=STATIC 
    -DSDL_SHARED=OFF 
    C:/SDL2-main/android64

-- DKEXECUTE_PROCESS():
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for limits.h
-- Looking for limits.h - found
-- Looking for float.h
-- Looking for float.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for wchar.h
-- Looking for wchar.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for ctype.h
-- Looking for ctype.h - found
-- Looking for math.h
-- Looking for math.h - found
-- Looking for iconv.h
-- Looking for iconv.h - found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for libunwind.h
-- Looking for libunwind.h - not found
-- Looking for 7 include files stddef.h, ..., float.h
-- Looking for 7 include files stddef.h, ..., float.h - found
-- Check size of size_t
-- Check size of size_t - done
-- Looking for M_PI
-- Looking for M_PI - found
-- Performing Test HAVE_MPROTECT
-- Performing Test HAVE_MPROTECT - Success
-- Looking for strtod
-- Looking for strtod - found
-- Looking for malloc
-- Looking for malloc - found
-- Looking for calloc
-- Looking for calloc - found
-- Looking for realloc
-- Looking for realloc - found
-- Looking for free
-- Looking for free - found
-- Looking for getenv
-- Looking for getenv - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for putenv
-- Looking for putenv - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for qsort
-- Looking for qsort - found
-- Looking for abs
-- Looking for abs - found
-- Looking for bcopy
-- Looking for bcopy - not found
-- Looking for memset
-- Looking for memset - found
-- Looking for memcpy
-- Looking for memcpy - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for memcmp
-- Looking for memcmp - found
-- Looking for strlen
-- Looking for strlen - found
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for strlcat
-- Looking for strlcat - found
-- Looking for _strrev
-- Looking for _strrev - not found
-- Looking for _strupr
-- Looking for _strupr - not found
-- Looking for _strlwr
-- Looking for _strlwr - not found
-- Looking for index
-- Looking for index - not found
-- Looking for rindex
-- Looking for rindex - not found
-- Looking for strchr
-- Looking for strchr - found
-- Looking for strrchr
-- Looking for strrchr - found
-- Looking for strstr
-- Looking for strstr - found
-- Looking for strtok_r
-- Looking for strtok_r - found
-- Looking for itoa
-- Looking for itoa - not found
-- Looking for _ltoa
-- Looking for _ltoa - not found
-- Looking for _uitoa
-- Looking for _uitoa - not found
-- Looking for _ultoa
-- Looking for _ultoa - not found
-- Looking for strtol
-- Looking for strtol - found
-- Looking for strtoul
-- Looking for strtoul - found
-- Looking for _i64toa
-- Looking for _i64toa - not found
-- Looking for _ui64toa
-- Looking for _ui64toa - not found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for atoi
-- Looking for atoi - found
-- Looking for atof
-- Looking for atof - found
-- Looking for strcmp
-- Looking for strcmp - found
-- Looking for strncmp
-- Looking for strncmp - found
-- Looking for _stricmp
-- Looking for _stricmp - not found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for _strnicmp
-- Looking for _strnicmp - not found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for wcscmp
-- Looking for wcscmp - found
-- Looking for _wcsdup
-- Looking for _wcsdup - not found
-- Looking for wcsdup
-- Looking for wcsdup - found
-- Looking for wcslcat
-- Looking for wcslcat - found
-- Looking for wcslcpy
-- Looking for wcslcpy - found
-- Looking for wcslen
-- Looking for wcslen - found
-- Looking for wcsncmp
-- Looking for wcsncmp - found
-- Looking for wcsstr
-- Looking for wcsstr - found
-- Looking for wcscasecmp
-- Looking for wcscasecmp - found
-- Looking for _wcsicmp
-- Looking for _wcsicmp - not found
-- Looking for wcsncasecmp
-- Looking for wcsncasecmp - found
-- Looking for _wcsnicmp
-- Looking for _wcsnicmp - not found
-- Looking for sscanf
-- Looking for sscanf - found
-- Looking for vsscanf
-- Looking for vsscanf - found
-- Looking for vsnprintf
-- Looking for vsnprintf - found
-- Looking for fopen64
-- Looking for fopen64 - not found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for fseeko64
-- Looking for fseeko64 - not found
-- Looking for _Exit
-- Looking for _Exit - found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for setjmp
-- Looking for setjmp - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for sysctlbyname
-- Looking for sysctlbyname - not found
-- Looking for getauxval
-- Looking for getauxval - found
-- Looking for elf_aux_info
-- Looking for elf_aux_info - not found
-- Looking for poll
-- Looking for poll - found
-- Looking for pow in m
-- Looking for pow in m - found
-- Looking for atan
-- Looking for atan - found
-- Looking for atan2
-- Looking for atan2 - found
-- Looking for atanf
-- Looking for atanf - found
-- Looking for atan2f
-- Looking for atan2f - found
-- Looking for ceil
-- Looking for ceil - found
-- Looking for ceilf
-- Looking for ceilf - found
-- Looking for copysign
-- Looking for copysign - found
-- Looking for copysignf
-- Looking for copysignf - found
-- Looking for cos
-- Looking for cos - found
-- Looking for cosf
-- Looking for cosf - found
-- Looking for exp
-- Looking for exp - found
-- Looking for expf
-- Looking for expf - found
-- Looking for fabs
-- Looking for fabs - found
-- Looking for fabsf
-- Looking for fabsf - found
-- Looking for floor
-- Looking for floor - found
-- Looking for floorf
-- Looking for floorf - found
-- Looking for fmod
-- Looking for fmod - found
-- Looking for fmodf
-- Looking for fmodf - found
-- Looking for log
-- Looking for log - found
-- Looking for logf
-- Looking for logf - found
-- Looking for log10
-- Looking for log10 - found
-- Looking for log10f
-- Looking for log10f - found
-- Looking for lround
-- Looking for lround - found
-- Looking for lroundf
-- Looking for lroundf - found
-- Looking for pow
-- Looking for pow - found
-- Looking for powf
-- Looking for powf - found
-- Looking for round
-- Looking for round - found
-- Looking for roundf
-- Looking for roundf - found
-- Looking for scalbn
-- Looking for scalbn - found
-- Looking for scalbnf
-- Looking for scalbnf - found
-- Looking for sin
-- Looking for sin - found
-- Looking for sinf
-- Looking for sinf - found
-- Looking for sqrt
-- Looking for sqrt - found
-- Looking for sqrtf
-- Looking for sqrtf - found
-- Looking for tan
-- Looking for tan - found
-- Looking for tanf
-- Looking for tanf - found
-- Looking for acos
-- Looking for acos - found
-- Looking for acosf
-- Looking for acosf - found
-- Looking for asin
-- Looking for asin - found
-- Looking for asinf
-- Looking for asinf - found
-- Looking for trunc
-- Looking for trunc - found
-- Looking for truncf
-- Looking for truncf - found
-- Looking for iconv_open in iconv
-- Looking for iconv_open in iconv - not found
-- Looking for iconv_open in c
-- Looking for iconv_open in c - not found
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for alloca
-- Looking for alloca - found
-- Looking for alloca
-- Looking for alloca - found
-- Looking for alloca
-- Looking for alloca - not found
-- Performing Test HAVE_SA_SIGACTION
-- Performing Test HAVE_SA_SIGACTION - Success
-- Looking for dlopen
-- Looking for dlopen - found
-- Performing Test HAVE_O_CLOEXEC
-- Performing Test HAVE_O_CLOEXEC - Success
-- Performing Test HAVE_ARM_MODE
-- Performing Test HAVE_ARM_MODE - Success
-- Performing Test VULKAN_PASSED_ANDROID_CHECKS
-- Performing Test VULKAN_PASSED_ANDROID_CHECKS - Success
-- Performing Test HAVE_PTHREADS
-- Performing Test HAVE_PTHREADS - Success
-- Performing Test HAVE_RECURSIVE_MUTEXES
-- Performing Test HAVE_RECURSIVE_MUTEXES - Success
-- Performing Test HAVE_PTHREADS_SEM
-- Performing Test HAVE_PTHREADS_SEM - Success
-- Performing Test HAVE_SEM_TIMEDWAIT
-- Performing Test HAVE_SEM_TIMEDWAIT - Success
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for include file pthread_np.h
-- Looking for include file pthread_np.h - not found
-- Performing Test HAVE_PTHREAD_SETNAME_NP
-- Performing Test HAVE_PTHREAD_SETNAME_NP - Success
-- Found Git: C:/Program Files (x86)/Git/cmd/git.exe (found version "2.30.1.windows.1")
--
-- SDL2 was configured with the following options:
--
-- Platform: Android-1
-- 64-bit:   TRUE
-- Compiler: C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Revision: https://github.com/aquawicket/DigitalKnob.git@d9f2c6993f8a37e6e64db3348a9c6d67591931e5
--
-- Subsystems:
--   Atomic:    ON
--   Audio:     ON
--   Video:     ON
--   Render:    ON
--   Events:    ON
--   Joystick:  ON
--   Haptic:    ON
--   Hidapi:    ON
--   Power:     ON
--   Threads:   ON
--   Timers:    ON
--   File:      ON
--   Loadso:    ON
--   CPUinfo:   ON
--   Filesystem:        ON
--   Dlopen:    ON
--   Sensor:    ON
--   Locale:    ON
--
-- Options:
--   SDL2_DISABLE_SDL2MAIN       (Wanted: OFF): OFF
--   SDL2_DISABLE_UNINSTALL      (Wanted: OFF): OFF
--   SDL_3DNOW                   (Wanted: ON): OFF
--   SDL_ALSA                    (Wanted: ON): OFF
--   SDL_ALSA_SHARED             (Wanted: ON): OFF
--   SDL_ALTIVEC                 (Wanted: ON): OFF
--   SDL_ARMNEON                 (Wanted: OFF): OFF
--   SDL_ARMSIMD                 (Wanted: OFF): OFF
--   SDL_ARTS                    (Wanted: ON): OFF
--   SDL_ARTS_SHARED             (Wanted: ON): OFF
--   SDL_ASAN                    (Wanted: OFF): OFF
--   SDL_ASSEMBLY                (Wanted: ON): OFF
--   SDL_ASSERTIONS              (Wanted: auto): auto
--   SDL_BACKGROUNDING_SIGNAL    (Wanted: OFF): OFF
--   SDL_CLOCK_GETTIME           (Wanted: ON): OFF
--   SDL_COCOA                   (Wanted: OFF): OFF
--   SDL_DIRECTFB                (Wanted: OFF): OFF
--   SDL_DIRECTFB_SHARED         (Wanted: OFF): OFF
--   SDL_DIRECTX                 (Wanted: OFF): OFF
--   SDL_DISKAUDIO               (Wanted: ON): ON
--   SDL_DUMMYAUDIO              (Wanted: ON): ON
--   SDL_DUMMYVIDEO              (Wanted: ON): ON
--   SDL_ESD                     (Wanted: ON): OFF
--   SDL_ESD_SHARED              (Wanted: ON): OFF
--   SDL_FOREGROUNDING_SIGNAL    (Wanted: OFF): OFF
--   SDL_FUSIONSOUND             (Wanted: OFF): OFF
--   SDL_FUSIONSOUND_SHARED      (Wanted: OFF): OFF
--   SDL_GCC_ATOMICS             (Wanted: OFF): OFF
--   SDL_HIDAPI_JOYSTICK         (Wanted: ON): ON
--   SDL_JACK                    (Wanted: ON): OFF
--   SDL_JACK_SHARED             (Wanted: ON): OFF
--   SDL_KMSDRM                  (Wanted: ON): OFF
--   SDL_KMSDRM_SHARED           (Wanted: ON): OFF
--   SDL_LIBC                    (Wanted: ON): ON
--   SDL_LIBSAMPLERATE           (Wanted: ON): OFF
--   SDL_LIBSAMPLERATE_SHARED    (Wanted: ON): OFF
--   SDL_METAL                   (Wanted: OFF): OFF
--   SDL_MMX                     (Wanted: ON): OFF
--   SDL_NAS                     (Wanted: ON): OFF
--   SDL_NAS_SHARED              (Wanted: ON): OFF
--   SDL_OFFSCREEN               (Wanted: OFF): OFF
--   SDL_OPENGL                  (Wanted: ON): OFF
--   SDL_OPENGLES                (Wanted: ON): ON
--   SDL_OSS                     (Wanted: ON): OFF
--   SDL_PIPEWIRE                (Wanted: ON): OFF
--   SDL_PIPEWIRE_SHARED         (Wanted: ON): OFF
--   SDL_PTHREADS                (Wanted: ON): ON
--   SDL_PTHREADS_SEM            (Wanted: ON): ON
--   SDL_PULSEAUDIO              (Wanted: ON): OFF
--   SDL_PULSEAUDIO_SHARED       (Wanted: ON): OFF
--   SDL_RENDER_D3D              (Wanted: OFF): OFF
--   SDL_RENDER_METAL            (Wanted: OFF): OFF
--   SDL_RPATH                   (Wanted: ON): OFF
--   SDL_RPI                     (Wanted: ON): OFF
--   SDL_SNDIO                   (Wanted: ON): OFF
--   SDL_SNDIO_SHARED            (Wanted: ON): OFF
--   SDL_SSE                     (Wanted: ON): OFF
--   SDL_SSE2                    (Wanted: ON): OFF
--   SDL_SSE3                    (Wanted: ON): OFF
--   SDL_SSEMATH                 (Wanted: ON): OFF
--   SDL_STATIC_PIC              (Wanted: OFF): OFF
--   SDL_TEST                    (Wanted: OFF): OFF
--   SDL_VIRTUAL_JOYSTICK        (Wanted: ON): ON
--   SDL_VIVANTE                 (Wanted: ON): OFF
--   SDL_VULKAN                  (Wanted: ON): ON
--   SDL_WASAPI                  (Wanted: OFF): OFF
--   SDL_WAYLAND                 (Wanted: ON): OFF
--   SDL_WAYLAND_LIBDECOR        (Wanted: ON): OFF
--   SDL_WAYLAND_LIBDECOR_SHARED (Wanted: ON): OFF
--   SDL_WAYLAND_QT_TOUCH        (Wanted: ON): OFF
--   SDL_WAYLAND_SHARED          (Wanted: ON): OFF
--   SDL_X11                     (Wanted: ON): OFF
--   SDL_X11_SHARED              (Wanted: ON): OFF
--   SDL_X11_XCURSOR             (Wanted: ON): OFF
--   SDL_X11_XDBE                (Wanted: ON): OFF
--   SDL_X11_XFIXES              (Wanted: ON): OFF
--   SDL_X11_XINERAMA            (Wanted: ON): OFF
--   SDL_X11_XINPUT              (Wanted: ON): OFF
--   SDL_X11_XRANDR              (Wanted: ON): OFF
--   SDL_X11_XSCRNSAVER          (Wanted: ON): OFF
--   SDL_X11_XSHAPE              (Wanted: ON): OFF
--   SDL_X11_XVM                 (Wanted: ON): OFF
--   SDL_XINPUT                  (Wanted: OFF): OFF
--
--  CFLAGS:        -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -DANDROID -DANDROID64 -std=c17
--  EXTRA_CFLAGS:
--  EXTRA_LDFLAGS:
--  EXTRA_LIBS:             
        m
        C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/libOpenSLES.so             C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/libdl.so             C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/liblog.so             C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/libandroid.so             C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/libGLESv1_CM.so             C:/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/26/libGLESv2.so
--
--  Build Shared Library: OFF
--  Build Static Library: ON
--  Build Static Library with Position Independent Code: OFF
--
-- If something was not detected, although the libraries
-- were installed, then make sure you have set the
-- CFLAGS and LDFLAGS environment variables correctly.
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/SDL2-main/android64

cd C:/SDL2-main/android64
C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/MSBuild.exe C:/SDL2-main/android64/SDL2.sln /t:SDL2-static /p:Configuration=Debug

Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 1/30/2022 10:44:11 AM.
Project "C:\SDL2-main\android64\SDL2.sln" on node 1 (SDL2-static target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|ARM64".
ValidateProjects:
  The project "INSTALL" is not selected for building in solution configuration "Debug|ARM64".
  The project "uninstall" is not selected for building in solution configuration "Debug|ARM64".
Project "C:\SDL2-main\android64\SDL2.sln" (1) is building "C:\SDL2-main\android64\SDL2-static.vcxproj.metaproj" (2) on node 1 (default targets).
Project "C:\SDL2-main\android64\SDL2-static.vcxproj.metaproj" (2) is building "C:\SDL2-main\android64\ZERO_CHECK.vcxproj" (3) on node 1 (default targets).
SetBuildDefaultEnvironmentVariables:
  ANDROID_HOME=C:/android-sdk
  ANT_HOME=C:/apache-ant-1.9.16
  JAVA_HOME=C:/openjdk-11
  NDK_ROOT=C:/android-sdk/ndk/22.1.7171670
InitializeBuildStatus:
  Creating "ARM64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  All outputs are up-to-date.
FinalizeBuildStatus:
  Deleting file "ARM64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "ARM64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\SDL2-main\android64\ZERO_CHECK.vcxproj" (default targets).
Project "C:\SDL2-main\android64\SDL2-static.vcxproj.metaproj" (2) is building "C:\SDL2-main\android64\SDL2-static.vcxproj" (4) on node 1 (default targets).
SetBuildDefaultEnvironmentVariables:
  ANDROID_HOME=C:/android-sdk
  ANT_HOME=C:/apache-ant-1.9.16
  JAVA_HOME=C:/openjdk-11
  NDK_ROOT=C:/android-sdk/ndk/22.1.7171670
InitializeBuildStatus:
  Touching "SDL2-static.dir\Debug\SDL2-static.tlog\unsuccessfulbuild".
CustomBuild:
  All outputs are up-to-date.
ClCompile:
  All outputs are up-to-date.
  All outputs are up-to-date.
  All outputs are up-to-date.
  All outputs are up-to-date.
  All outputs are up-to-date.
  All outputs are up-to-date.
  All outputs are up-to-date.
  C:/android-sdk/ndk/22.1.7171670\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe -c -fdiagnostics-format=msvc -gcc-toolchain "C:/android-sdk/ndk/22.1.7171670\\toolchains\\aarch64-linux-android-4.9\\prebuilt\\windows-x86_64" -target "aarch64-none-linux-android21" --sysroot="C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\sysroot" -isystem "C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\sysroot\\usr\\include\\aarch64-linux-android" -isystem "C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\lib64\\clang\\11.0.5\\include" -isystem "C:/android-sdk/ndk/22.1.7171670\\sources\\android\\support\\include" -isystem "C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\sysroot\\usr\\include" -I "C:\\SDL2-main\\android64\\include" -I "C:\\SDL2-main\\include" -I "C:\\SDL2-main\\src\\video\\khronos" -I "C:\\android-sdk\\ndk\\22.1.7171670\\sources\\android\\cpufeatures" -I "C:/android-sdk/ndk/22.1.7171670\\sources\\cxx-stl\\llvm-libc++\\include" -I "C:/android-sdk/ndk/22.1.7171670\\sources\\cxx-stl\\llvm-libc++abi\\include" -I "C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\sysroot\\usr\\include" -I "C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\sysroot\\usr\\include\\aarch64-linux-android" -I "C:/android-sdk/ndk/22.1.7171670\\sources\\android\\support\\include" -I "C:/android-sdk/ndk/22.1.7171670\\toolchains\\llvm\\prebuilt\\windows-x86_64\\lib64\\clang\\11.0.5\\include" -gline-tables-only -o "SDL2-static.dir\\Debug\\SDL_spinlock.o" -Wall -O3 -fno-strict-aliasing -fomit-frame-pointer -fno-exceptions -ffunction-sections -fdata-sections -fstack-protector -fpic -fno-short-enums -D __ANDROID_API__=21 -D NDEBUG -D ANDROID -D _FORTIFY_SOURCE=2 -D ANDROID64 -D DEBUG -D _DEBUG -D USING_GENERATED_CONFIG_H -D GL_GLEXT_PROTOTYPES -D "CMAKE_INTDIR=\"Debug\"" -x c  -g -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wformat -Werror=format-security -O0 -fno-limit-debug-info -g -marm "C:\\SDL2-main\\src\\atomic\\SDL_spinlock.c"
  SDL_spinlock.c
clang : warning : argument unused during compilation: '-marm' [-Wunused-command-line-argument] [C:\SDL2-main\android64\SDL2-static.vcxproj]
C:\SDL2-main\src\atomic\SDL_spinlock.c(136,2): error : Please implement for your platform. [C:\SDL2-main\android64\SDL2-static.vcxproj]
  #error Please implement for your platform.
   ^
  1 error generated.
Done Building Project "C:\SDL2-main\android64\SDL2-static.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\SDL2-main\android64\SDL2-static.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\SDL2-main\android64\SDL2.sln" (SDL2-static target(s)) -- FAILED.

Build FAILED.

"C:\SDL2-main\android64\SDL2.sln" (SDL2-static target) (1) ->
"C:\SDL2-main\android64\SDL2-static.vcxproj.metaproj" (default target) (2) ->
"C:\SDL2-main\android64\SDL2-static.vcxproj" (default target) (4) ->
(ClCompile target) ->
  clang : warning : argument unused during compilation: '-marm' [-Wunused-command-line-argument] [C:\SDL2-main\android64\SDL2-static.vcxproj]

"C:\SDL2-main\android64\SDL2.sln" (SDL2-static target) (1) ->
"C:\SDL2-main\android64\SDL2-static.vcxproj.metaproj" (default target) (2) ->
"C:\SDL2-main\android64\SDL2-static.vcxproj" (default target) (4) ->
(ClCompile target) ->
  C:\SDL2-main\src\atomic\SDL_spinlock.c(136,2): error : Please implement for your platform. [C:\SDL2-main\android64\SDL2-static.vcxproj]

    1 Warning(s)
    1 Error(s)
aquawicket commented 2 years ago

I figured out how to get this to compile. It seems generating the build this way enables the USING_GENERATED_CONFIG_H flag. This causes SDL_config.h to bypass SDL_config_android.h, And in doing so, the HAVE_GCC_ATOMICS in not defined, which seems to be needed by arm64.

My workaround was to call cmake with -DCMAKE_CXX_FLAGS=-DHAVE_GCC_ATOMICS=1... added to the cxx_flags.