Hi,

I am trying to use another compiler than the default one installed on my 
system. I have to do this because I want to use a newer gcc than the one on 
centos 7,so I installed RedHat Developer Toolset 3 with gcc 4.9. When I call 
cmake with
scl enable devtoolset-3 "cmake ../src" in my build directory, it generates 
makefiles which use the new compiler and linker, but still uses the default 
/usr/bin/ar etc. This is problematic because I enable 
whole-program-optimization in release mode, and this needs to use the ar 
provided with gcc 4.9 to handle the link-time optimization object files.

I have tried various things to force cmake to use a specific ar, but none of 
these worked:

-       Manually set CMAKE_AR in the CMakeLists.txt

-       Change CMAKE_AR in the cache

-       Write my own toolchain file
With the toolchain file, cmake creates Makefiles but puts an empty ar command 
in the lib "link" command, and building thus fails with an error.

Am I missing something?

Best wishes,
  Jens Auer


--
Dr. Jens Auer | CGI | Software Engineer
CGI Deutschland Ltd. & Co. KG
Rheinstraße 95 | 64295 Darmstadt | Germany
T: +49 6151 36860 154
jens.a...@cgi.com<mailto:jens.a...@cgi.com>
Unsere Pflichtangaben gemäß § 35a GmbHG / §§ 161, 125a HGB finden Sie unter 
de.cgi.com/pflichtangaben<http://de.cgi.com/pflichtangaben>.

CONFIDENTIALITY NOTICE: Proprietary/Confidential information belonging to CGI 
Group Inc. and its affiliates may be contained in this message. If you are not 
a recipient indicated or intended in this message (or responsible for delivery 
of this message to such person), or you think for any reason that this message 
may have been addressed to you in error, you may not use or copy or deliver 
this message to anyone else. In such case, you should destroy this message and 
are asked to notify the sender by reply e-mail.

-- 

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