Commit 73934188 authored by Ruslan Baratov's avatar Ruslan Baratov Committed by Brad King

Rename CMAKE_GCC_{AR,RANLIB} to CMAKE_LANG_COMPILER_{AR,RANLIB}

The variables recently added by commit b9d36826 (Add 'CMAKE_GCC_AR' and
'CMAKE_GCC_RANLIB' variables, 2017-03-08) are more appropriately managed
with language-specific names rather than toolchain-specific names.
parent b2feb958
......@@ -40,8 +40,6 @@ Variables that Provide Information
/variable/CMAKE_FIND_PACKAGE_NAME
/variable/CMAKE_FIND_PACKAGE_SORT_DIRECTION
/variable/CMAKE_FIND_PACKAGE_SORT_ORDER
/variable/CMAKE_GCC_AR
/variable/CMAKE_GCC_RANLIB
/variable/CMAKE_GENERATOR
/variable/CMAKE_GENERATOR_PLATFORM
/variable/CMAKE_GENERATOR_TOOLSET
......@@ -50,6 +48,8 @@ Variables that Provide Information
/variable/CMAKE_IMPORT_LIBRARY_SUFFIX
/variable/CMAKE_JOB_POOL_COMPILE
/variable/CMAKE_JOB_POOL_LINK
/variable/CMAKE_LANG_COMPILER_AR
/variable/CMAKE_LANG_COMPILER_RANLIB
/variable/CMAKE_LINK_LIBRARY_SUFFIX
/variable/CMAKE_LINK_SEARCH_END_STATIC
/variable/CMAKE_LINK_SEARCH_START_STATIC
......
compiler_archiving_tools
------------------------
* A :variable:`CMAKE_<LANG>_COMPILER_AR` variable was added to hold
the path to the GCC/Clang wrapper of ``ar``.
* A :variable:`CMAKE_<LANG>_COMPILER_RANLIB` variable was added to hold
the path to the GCC/Clang wrapper of ``ranlib``.
gcc_archiving_tools
-------------------
* The :variable:`CMAKE_GCC_AR` variable with the path to GCC wrapper of ``ar``
utility was added.
* The :variable:`CMAKE_GCC_RANLIB` variable with the path to GCC wrapper of
``ranlib`` utility was added.
CMAKE_GCC_AR
------------
CMAKE_<LANG>_COMPILER_AR
------------------------
A wrapper around ``ar`` adding the appropriate ``--plugin`` option for the
GCC compiler. For other compilers variable is not defined.
compiler.
See also :variable:`CMAKE_AR`.
CMAKE_GCC_RANLIB
----------------
CMAKE_<LANG>_COMPILER_RANLIB
----------------------------
A wrapper around ``ranlib`` adding the appropriate ``--plugin`` option for the
GCC compiler. For other compilers variable is not defined.
compiler.
See also :variable:`CMAKE_RANLIB`.
set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_GCC_AR "@CMAKE_GCC_AR@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_AR "@_CMAKE_ASM_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_RANLIB "@_CMAKE_ASM_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
......
......@@ -14,9 +14,9 @@ set(CMAKE_C_SIMULATE_ID "@CMAKE_C_SIMULATE_ID@")
set(CMAKE_C_SIMULATE_VERSION "@CMAKE_C_SIMULATE_VERSION@")
@SET_MSVC_C_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_GCC_AR "@CMAKE_GCC_AR@")
set(CMAKE_C_COMPILER_AR "@CMAKE_C_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@")
set(CMAKE_C_COMPILER_RANLIB "@CMAKE_C_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
set(CMAKE_C_COMPILER_LOADED 1)
......
......@@ -15,9 +15,9 @@ set(CMAKE_CXX_SIMULATE_ID "@CMAKE_CXX_SIMULATE_ID@")
set(CMAKE_CXX_SIMULATE_VERSION "@CMAKE_CXX_SIMULATE_VERSION@")
@SET_MSVC_CXX_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_GCC_AR "@CMAKE_GCC_AR@")
set(CMAKE_CXX_COMPILER_AR "@CMAKE_CXX_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@")
set(CMAKE_CXX_COMPILER_RANLIB "@CMAKE_CXX_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
set(CMAKE_CXX_COMPILER_LOADED 1)
......
......@@ -157,6 +157,8 @@ set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
set(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
set(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
set(_CMAKE_ASM_COMPILER_AR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_AR}")
set(_CMAKE_ASM_COMPILER_RANLIB "${CMAKE_ASM${ASM_DIALECT}_COMPILER_RANLIB}")
# configure variables set in this file for fast reload later on
configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
......@@ -165,3 +167,5 @@ configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
set(_CMAKE_ASM_COMPILER)
set(_CMAKE_ASM_COMPILER_ARG1)
set(_CMAKE_ASM_COMPILER_ENV_VAR)
set(_CMAKE_ASM_COMPILER_AR)
set(_CMAKE_ASM_COMPILER_RANLIB)
......@@ -8,9 +8,9 @@ set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
@SET_MSVC_Fortran_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_GCC_AR "@CMAKE_GCC_AR@")
set(CMAKE_Fortran_COMPILER_AR "@CMAKE_Fortran_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_GCC_RANLIB "@CMAKE_GCC_RANLIB@")
set(CMAKE_Fortran_COMPILER_RANLIB "@CMAKE_Fortran_COMPILER_RANLIB@")
set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
set(CMAKE_Fortran_COMPILER_LOADED 1)
set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@)
......
......@@ -9,7 +9,7 @@ string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
get_filename_component(__gcc_hints "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER}" DIRECTORY)
# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ar.1.html
find_program(CMAKE_GCC_AR NAMES
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_AR NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}"
HINTS ${__gcc_hints}
......@@ -17,7 +17,7 @@ find_program(CMAKE_GCC_AR NAMES
)
# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ranlib.1.html
find_program(CMAKE_GCC_RANLIB NAMES
find_program(CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_RANLIB NAMES
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}"
HINTS ${__gcc_hints}
......
......@@ -73,15 +73,15 @@ macro(__compiler_gnu lang)
#
# [1]: https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/Optimize-Options.html
set(CMAKE_${lang}_ARCHIVE_CREATE_IPO
"${CMAKE_GCC_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>"
"${CMAKE_${lang}_COMPILER_AR} cr <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_APPEND_IPO
"${CMAKE_GCC_AR} r <TARGET> <LINK_FLAGS> <OBJECTS>"
"${CMAKE_${lang}_COMPILER_AR} r <TARGET> <LINK_FLAGS> <OBJECTS>"
)
set(CMAKE_${lang}_ARCHIVE_FINISH_IPO
"${CMAKE_GCC_RANLIB} <TARGET>"
"${CMAKE_${lang}_COMPILER_RANLIB} <TARGET>"
)
endif()
endmacro()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment