Fix ios device build issue

This commit is contained in:
halx99 2022-07-14 17:20:18 +08:00
parent 11be5350f9
commit a402a80ad7
3 changed files with 8 additions and 8 deletions

View File

@ -116,11 +116,11 @@ See [windows workflow guide](https://github.com/axis-project/axis/issues/564)
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
3. Generate xcode project
- for arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$axis_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=arm64```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AXIS_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=arm64```
- for armv7,arm64 combined:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$axis_ROOT/cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64"```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AXIS_ROOT/cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64"```
- for simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$axis_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AXIS_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64```
4. After cmake finishes generating, you can open the xcode project at ```build``` folder and run cpp-tests or other test targets.
5. Notes

View File

@ -85,11 +85,11 @@
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
3. 生成xcode工程, 进入axis根目录执行如下命令之一:
- for arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=arm64```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AXIS_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=arm64```
- for armv7,arm64 combined:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64"```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AXIS_ROOT/cmake/ios.mini.cmake "-DCMAKE_OSX_ARCHITECTURES=armv7;arm64"```
- for simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64```
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AXIS_ROOT/cmake/ios.mini.cmake -DCMAKE_OSX_ARCHITECTURES=x86_64```
4. 之后就可以用xcode打开, 选择cpp-tests编译运行

View File

@ -52,7 +52,7 @@ endif()
# Sets CMAKE_SYSTEM_PROCESSOR for iphoneos and iphonesimulator
string(TOLOWER "${CMAKE_OSX_SYSROOT}" lowercase_CMAKE_OSX_SYSROOT)
if("${lowercase_CMAKE_OSX_SYSROOT}" MATCHES "iphonesimulator")
set(IOS_PLATFORM "SIMULATOR" CACHE STRING "")
set(IMC_IOS_PLAT "SIMULATOR" CACHE STRING "")
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "i386")
set(CMAKE_SYSTEM_PROCESSOR i386)
elseif("${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64")
@ -65,6 +65,6 @@ if("${lowercase_CMAKE_OSX_SYSROOT}" MATCHES "iphonesimulator")
endif()
endif()
else()
set(IOS_PLATFORM "DEVICE" CACHE STRING "")
set(IMC_IOS_PLAT "DEVICE" CACHE STRING "")
set(CMAKE_SYSTEM_PROCESSOR arm64)
endif()