Discussion:
[cmake-developers] CMAKE_C_COMPILER_ARG# not documented?
Robert Dailey
2018-07-19 15:58:11 UTC
Permalink
I can't remember where I heard about these CMake variables, but in one
of my toolchain files I do this:

set( CMAKE_C_COMPILER_ARG1 -m32 )
set( CMAKE_CXX_COMPILER_ARG1 -m32 )

On the [cmake variables][1] page, these are not documented. I expected
an entry somewhere like `CMAKE_<LANG>_COMPILER_ARG<#>` but there isn't
one. Are these documented? If so, where? If not, I'll create an issue
on the gitlab project page to make sure that gets done at some point.
I would offer to do it but I'm not too sure what the variables do
myself, nor am I sure what the upper limit for ARG is.

[1]: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Brad King
2018-07-19 18:07:49 UTC
Permalink
Post by Robert Dailey
I can't remember where I heard about these CMake variables, but in one
set( CMAKE_C_COMPILER_ARG1 -m32 )
set( CMAKE_CXX_COMPILER_ARG1 -m32 )
They are not documented because they are internal implementation
details. Projects should not be setting them.

-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:
https://cmake.org/mailman/listinfo/cmake-developers
Robert Dailey
2018-07-19 18:13:52 UTC
Permalink
Post by Brad King
Post by Robert Dailey
I can't remember where I heard about these CMake variables, but in one
set( CMAKE_C_COMPILER_ARG1 -m32 )
set( CMAKE_CXX_COMPILER_ARG1 -m32 )
They are not documented because they are internal implementation
details. Projects should not be setting them.
I think this was recommended to me because `-m32` had to be the first
argument to clang. I'll try to dig up the conversation, I forgot who
recommended it and why.
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Robert Dailey
2018-07-19 18:17:05 UTC
Permalink
Post by Robert Dailey
Post by Brad King
Post by Robert Dailey
I can't remember where I heard about these CMake variables, but in one
set( CMAKE_C_COMPILER_ARG1 -m32 )
set( CMAKE_CXX_COMPILER_ARG1 -m32 )
They are not documented because they are internal implementation
details. Projects should not be setting them.
I think this was recommended to me because `-m32` had to be the first
argument to clang. I'll try to dig up the conversation, I forgot who
recommended it and why.
Found it:
https://cmake.org/pipermail/cmake/2013-March/054161.html

Looks like something Bill Hoffman suggested years ago. I still don't
remember why I started using it, it was definitely to work around some
sort of issue. What is the proper, public API solution that gives
identical functionality? Should I be using `CMAKE_C_COMPILER` instead,
and appending to it as a string from my toolchain file?

Thanks in advance.
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Robert Dailey
2018-07-19 18:25:41 UTC
Permalink
Post by Robert Dailey
Post by Robert Dailey
Post by Brad King
Post by Robert Dailey
I can't remember where I heard about these CMake variables, but in one
set( CMAKE_C_COMPILER_ARG1 -m32 )
set( CMAKE_CXX_COMPILER_ARG1 -m32 )
They are not documented because they are internal implementation
details. Projects should not be setting them.
I think this was recommended to me because `-m32` had to be the first
argument to clang. I'll try to dig up the conversation, I forgot who
recommended it and why.
https://cmake.org/pipermail/cmake/2013-March/054161.html
Looks like something Bill Hoffman suggested years ago. I still don't
remember why I started using it, it was definitely to work around some
sort of issue. What is the proper, public API solution that gives
identical functionality? Should I be using `CMAKE_C_COMPILER` instead,
and appending to it as a string from my toolchain file?
Thanks in advance.
Looking at the docs a bit closer, it seems like this is the better solution:

set( CMAKE_C_FLAGS_INIT -m32 )
set( CMAKE_CXX_FLAGS_INIT -m32 )

Not sure if you'd agree, but at least I can verify it is working.
--
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:
https://cmake.org/mailman/listinfo/cmake-developers
Loading...