CheckTypeSize does not work with iOS cross-compilation
Hi ! I may have identified a problem with iOS cross-compilation. Thank you in advance for the support, I'm available if you need more details.
Issue
I'm trying to compile a library with iOS cross-compilation. I'm following the code example from CMake 3.14.1 documentation. CMake module CheckTypeSize
doesn't set type sizes when calling check_type_size
. Native compilation on MacOS doesn't cause any problem.
This may be due to the CheckTypeSize
module not finding the following headers :
- sys/types.h
- stdint.h
- stddef.h
You will find here a simple repository containing a CMakeLists.txt and a toolchain file showing the problem.
Environment
- MacOSX Mojave 10.14
- XCode 10.1, with xcode-select installed
- CMake 3.14.1
- Using either command line for setting CMake cross-compilation variables or a toolchain file
I've tried to configure the project with and without the following CMake variables :
- Xcode generator
-
CMAKE_OSX_SYSROOT
set to/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
Logs
Native MacOS CMake configuration output : nativeConfigure.log
iOS toolchain CMake configuration output toolchainConfigure.log