GitHub user lucaceresoli opened a pull request: https://github.com/apache/qpid-proton/pull/46
proton-c: fix C compiler detection with _ARG1/_ARG2 The C compiler commandline in CMake is composed by the concatenation of CMAKE_C_COMPILER + CMAKE_C_COMPILER_ARG1 + CMAKE_C_COMPILER_ARG2. In most use cases the two additional argument variables are empty, thus CMAKE_C_COMPILER can be used without any noticeable difference. The Buildroot embedded Linux build system [0], however, optionally exploits the CMAKE_C_COMPILER_ARG1 variable to speed up the cross-compilation of CMake-based packages using ccache. It does so by setting [1]: CMAKE_C_COMPILER = /path/to/ccache CMAKE_C_COMPILER_ARG1 = /path/to/cross-gcc This works fine with other CMake-based packages, but proton-c's CMakeLists.txt calls gcc to extract the compiler version. It does so by calling "${CMAKE_C_COMPILER} -dumpversion", without honoring the two extra arguments. Within Buildroot with ccache enabled, this means calling "/path/to/ccache -dumpversion", which fails with the error: ccache: invalid option -- 'd' Fix the compiler check by adding the two arguments. [0] http://buildroot.net/ [1] http://git.buildroot.net/buildroot/tree/support/misc/toolchainfile.cmake.in?id=2015.05 Signed-off-by: Luca Ceresoli <l...@lucaceresoli.net> You can merge this pull request into a Git repository by running: $ git pull https://github.com/lucaceresoli/qpid-proton luca/fix-gcc-check Alternatively you can review and apply these changes as the patch at: https://github.com/apache/qpid-proton/pull/46.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #46 ---- commit f24be9ae9ab01c7507a366e9d5529c444f0b7edd Author: Luca Ceresoli <l...@lucaceresoli.net> Date: 2015-07-10T08:13:47Z proton-c: fix C compiler detection with _ARG1/_ARG2 The C compiler commandline in CMake is composed by the concatenation of CMAKE_C_COMPILER + CMAKE_C_COMPILER_ARG1 + CMAKE_C_COMPILER_ARG2. In most use cases the two additional argument variables are empty, thus CMAKE_C_COMPILER can be used without any noticeable difference. The Buildroot embedded Linux build system [0], however, optionally exploits the CMAKE_C_COMPILER_ARG1 variable to speed up the cross-compilation of CMake-based packages using ccache. It does so by setting [1]: CMAKE_C_COMPILER = /path/to/ccache CMAKE_C_COMPILER_ARG1 = /path/to/cross-gcc This works fine with other CMake-based packages, but proton-c's CMakeLists.txt calls gcc to extract the compiler version. It does so by calling "${CMAKE_C_COMPILER} -dumpversion", without honoring the two extra arguments. Within Buildroot with ccache enabled, this means calling "/path/to/ccache -dumpversion", which fails with the error: ccache: invalid option -- 'd' Fix the compiler check by adding the two arguments. [0] http://buildroot.net/ [1] http://git.buildroot.net/buildroot/tree/support/misc/toolchainfile.cmake.in?id=2015.05 Signed-off-by: Luca Ceresoli <l...@lucaceresoli.net> ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---