I suspect that if the first source in a target is C++, every source in
that targets gets CMAKE_CXX_FLAGS, otherwise CMAKE_C_FLAGS. So for
now, mixing C and C++ sources in the same target is broken.

I worked around this issue by putting C sources in their own static
library, and linking that into the main shared library.

Florent, thanks for the response and especially the links. We use the
VS generator for some platforms, Ninja for Android and a couple
others. I'm tasked with improving our edit-build-debug workflow by
specifically migrating to Visual Studio for Android. We have a
modified taka-no-me toolchain file, but current employees don't know
its exact provenance so getting/merging updates is problematic. I
thought the stock toolchain file provided by the latest NDK would give
us the best results, at least until Kitware/CMake,
Microsoft/CMake/VCMDDAndroid, Nsight Tegra VS Edition and the NDK work
out their differences.


On Wed, Dec 14, 2016 at 7:57 PM, Florent Castelli
<florent.caste...@gmail.com> wrote:
> I'm pretty sure that the toolchain bundled with the NDK, made by Google,
> hasn't been tested with other generators than Ninja or possibly Make.
> Also, there are some known bugs with it, including the one related to
> CMAKE_CXX_STANDARD (see
> https://code.google.com/p/android/issues/detail?id=227915 and
> https://github.com/android-ndk/ndk/issues/222 ).
>
> I'd recommend using other generators if you want to use this toolchain or
> maybe try the Android support released with CMake 3.7.1 instead, though I
> have no idea if it's supposed to work with the Visual Studio generators
> either!
>
> /Florent
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to