cpu.cmake: Address issues in SVE feature tests

A test to check that SVE registers were correctly handled as function
parameters was added in 5ccdc66ab6eb8eb300eda854fab4ff250b2c2f92,
however this appears to have a couple of issues:

* Semicolons need to be escaped, else the compiler fails to compile due
  to invalid syntax. We can fix this by prefixing each semicolon with a
  backslash.

* The "other" function does not have a definition so the test program
  will always fail to link even if it compiles to an object file. We can
  work around this by instructing CMake to only try compiling up to a
  static library rather than a full executable.

Change-Id: Ic37280d4b42b9031e68bed8a4b24c0eb51491827
diff --git a/build/cmake/cpu.cmake b/build/cmake/cpu.cmake
index e16e9ec..8d0acf3 100644
--- a/build/cmake/cpu.cmake
+++ b/build/cmake/cpu.cmake
@@ -49,7 +49,9 @@
   # SVE and SVE2 require that the Neon-SVE bridge header is also available.
   if(ENABLE_SVE OR ENABLE_SVE2)
     set(OLD_CMAKE_REQURED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    set(OLD_CMAKE_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${AOM_SVE_FLAG}")
+    set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
     aom_check_source_compiles("arm_neon_sve_bridge_available" "
 #ifndef __ARM_NEON_SVE_BRIDGE
 #error 1
@@ -61,12 +63,13 @@
     # to fail this, see https://github.com/llvm/llvm-project/issues/80009.
     aom_check_source_compiles("arm_sve_preserve" "
 #include <arm_sve.h>
-void other(void);
+void other(void)\;
 svfloat32_t func(svfloat32_t a) {
-  other();
-  return a;
+  other()\;
+  return a\;
 }" CAN_COMPILE_SVE)
     set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQURED_FLAGS})
+    set(CMAKE_TRY_COMPILE_TARGET_TYPE ${OLD_CMAKE_TRY_COMPILE_TARGET_TYPE})
     if(HAVE_SVE_HEADERS EQUAL 0 OR CAN_COMPILE_SVE EQUAL 0)
       set(ENABLE_SVE 0)
       set(ENABLE_SVE2 0)