On 09/22/2015 04:29 PM, Stephen Kelly wrote:
> I've pushed fix-forced-toolchain-dialect to fix this. It uses an existing 
> mechanism already in use to determine whether the compiler was forced.

Looks good, thanks.

> Is there any legitimate need to force the compiler?

The CMakeForceCompiler module was added here:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fda7753f

The commit message mentions:

 ... embedded compilers need a user specific linker file for compiling
 an executable ... thus cannot build the compiler-id program...

Since then the compiler id logic has learned to do things like pass
the --version flag and match vendor-specific output.  That could be
used to identify these embedded compilers.  Then the test for working
compiler will still need a linker file but perhaps we can generate
one once we know the compiler id.

> For example, why does the android toolchain file force GNU and Clang 
> compilers? Is it misunderstanding on the part of the toolchain author?

I don't think the android.toolchain.cmake file needs to force the
compiler.  It can simply set CMAKE_{C,CXX}_COMPILER and let the
normal detection proceed.

> Ie: Should CmakeForceCompiler.cmake be deprecated? It seems to date from a 
> time when the compiler id and whether it 'basically works' were the only 
> things CMake wished to know in order to initialize. Today there is much 
> more, including compiler version, ABI and features. 

Yes, I think it should be deprecated if possible.  First we must
provide alternatives for all its use cases though.

-Brad

-- 

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-developers

Reply via email to