Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cotire 1.7.10 fails to generate precompiled headers on Android with CMake 3.10 on Windows #146

Open
MaxSavenkov opened this issue Jan 5, 2018 · 4 comments

Comments

@MaxSavenkov
Copy link

Trying to generate a precompiled header results in error:

clang++.exe: warning: argument unused during compilation: '-mthumb'
clang++.exe: warning: argument unused during compilation: '-mfpu=vfpv3-d16'
clang++.exe: warning: argument unused during compilation: '-mfloat-abi=softfp'
error: unknown target CPU 'armv7-a'

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

@In-line
Copy link

In-line commented May 16, 2018

Same issue

mkorotetsky pushed a commit to mkorotetsky/cotire that referenced this issue Jul 24, 2018
fix of sakra#104
based on old commit because of the issue
sakra#146 after recent repo changes
@robneval
Copy link

robneval commented Dec 6, 2018

Same issue.
I disabled the precompiled header for the target to workaround this.
set_target_properties("${target}" PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)

@Zaffy
Copy link

Zaffy commented Jun 7, 2019

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}")

@robneval
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants