try_compile fails with strange error when cross-compiling iOS binaries from Linux
It seems that try_compile doesn't account for iOS bundles when cross-compiling iOS from Linux. Simple repro:
https://github.com/russelltg/cmake-ios-try-copmile
the output I get is
-- The C compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of size_t
CMake Error at /usr/share/cmake/Modules/CheckTypeSize.cmake:146 (try_compile):
Cannot copy output executable
''
to destination specified by COPY_FILE:
'/home/russell/testioscross/build/CMakeFiles/CheckTypeSize/SIZE_OF_SIZE_T.bin'
Unable to find the executable at any of:
/home/russell/testioscross/build/CMakeFiles/CMakeTmp/cmTC_29779
/home/russell/testioscross/build/CMakeFiles/CMakeTmp/Debug/cmTC_29779
/home/russell/testioscross/build/CMakeFiles/CMakeTmp/Development/cmTC_29779
Call Stack (most recent call first):
/usr/share/cmake/Modules/CheckTypeSize.cmake:277 (__check_type_size_impl)
CMakeLists.txt:9 (check_type_size)
-- Configuring incomplete, errors occurred!
See also "/home/russell/testioscross/build/CMakeFiles/CMakeOutput.log".
It seems like this should be a supported usecase, and I imagine the fix is simple