Open MaxSavenkov opened 6 years ago
Same issue
Same issue.
I disabled the precompiled header for the target to workaround this.
set_target_properties("${target}" PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)
I ran into the same issue, If you don't want to modify (fix) cotire, just pass the target to compiler and linker manually.
Example:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fshort-wchar --target=${CMAKE_CXX_COMPILER_TARGET}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fshort-wchar --target=${CMAKE_C_COMPILER_TARGET}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --target=${CMAKE_CXX_COMPILER_TARGET}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --target=${CMAKE_C_COMPILER_TARGET}")
@Zaffy that made the unknown target disappear. But for me when compiling cotired files Android NDK headers are not found. No problems when i disable precompiled headers.
Trying to generate a precompiled header results in error:
Log file: log.txt
At the same time, if precompiled header generation is removed, the code is compiled without any problems, so the CMakeLists itself works. It seems that Cotire(?) fails to forward some flags to clang (in particular, --target with triplet seem to be missing from the clang++ invocation, see log).
Example project is attached. See configure_ndr.cmd for the set of CMake options, change the path to Android NDK (CMAKE_ANDROID_NDK) in configure_ndr.cmd to your own to make it work.
cotire_test.zip