From 73934188446d2f8b149d5458008e1b267b37c3d9 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Sun, 2 Apr 2017 22:29:31 +0800 Subject: 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. --- Help/manual/cmake-variables.7.rst | 4 ++-- Help/release/dev/compiler_archiving_tools.rst | 8 ++++++++ Help/release/dev/gcc_archiving_tools.rst | 8 -------- Help/variable/CMAKE_GCC_AR.rst | 7 ------- Help/variable/CMAKE_GCC_RANLIB.rst | 7 ------- Help/variable/CMAKE_LANG_COMPILER_AR.rst | 7 +++++++ Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst | 7 +++++++ Modules/CMakeASMCompiler.cmake.in | 4 ++-- Modules/CMakeCCompiler.cmake.in | 4 ++-- Modules/CMakeCXXCompiler.cmake.in | 4 ++-- Modules/CMakeDetermineASMCompiler.cmake | 4 ++++ Modules/CMakeFortranCompiler.cmake.in | 4 ++-- Modules/Compiler/GNU-FindBinUtils.cmake | 4 ++-- Modules/Compiler/GNU.cmake | 6 +++--- 14 files changed, 41 insertions(+), 37 deletions(-) create mode 100644 Help/release/dev/compiler_archiving_tools.rst delete mode 100644 Help/release/dev/gcc_archiving_tools.rst delete mode 100644 Help/variable/CMAKE_GCC_AR.rst delete mode 100644 Help/variable/CMAKE_GCC_RANLIB.rst create mode 100644 Help/variable/CMAKE_LANG_COMPILER_AR.rst create mode 100644 Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 9d8d596..c45574f 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -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 diff --git a/Help/release/dev/compiler_archiving_tools.rst b/Help/release/dev/compiler_archiving_tools.rst new file mode 100644 index 0000000..de3471d --- /dev/null +++ b/Help/release/dev/compiler_archiving_tools.rst @@ -0,0 +1,8 @@ +compiler_archiving_tools +------------------------ + +* A :variable:`CMAKE__COMPILER_AR` variable was added to hold + the path to the GCC/Clang wrapper of ``ar``. + +* A :variable:`CMAKE__COMPILER_RANLIB` variable was added to hold + the path to the GCC/Clang wrapper of ``ranlib``. diff --git a/Help/release/dev/gcc_archiving_tools.rst b/Help/release/dev/gcc_archiving_tools.rst deleted file mode 100644 index b3cc7d6..0000000 --- a/Help/release/dev/gcc_archiving_tools.rst +++ /dev/null @@ -1,8 +0,0 @@ -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. diff --git a/Help/variable/CMAKE_GCC_AR.rst b/Help/variable/CMAKE_GCC_AR.rst deleted file mode 100644 index ac90b46..0000000 --- a/Help/variable/CMAKE_GCC_AR.rst +++ /dev/null @@ -1,7 +0,0 @@ -CMAKE_GCC_AR ------------- - -A wrapper around ``ar`` adding the appropriate ``--plugin`` option for the -GCC compiler. For other compilers variable is not defined. - -See also :variable:`CMAKE_AR`. diff --git a/Help/variable/CMAKE_GCC_RANLIB.rst b/Help/variable/CMAKE_GCC_RANLIB.rst deleted file mode 100644 index 3d42aba..0000000 --- a/Help/variable/CMAKE_GCC_RANLIB.rst +++ /dev/null @@ -1,7 +0,0 @@ -CMAKE_GCC_RANLIB ----------------- - -A wrapper around ``ranlib`` adding the appropriate ``--plugin`` option for the -GCC compiler. For other compilers variable is not defined. - -See also :variable:`CMAKE_RANLIB`. diff --git a/Help/variable/CMAKE_LANG_COMPILER_AR.rst b/Help/variable/CMAKE_LANG_COMPILER_AR.rst new file mode 100644 index 0000000..b83a1d4 --- /dev/null +++ b/Help/variable/CMAKE_LANG_COMPILER_AR.rst @@ -0,0 +1,7 @@ +CMAKE__COMPILER_AR +------------------------ + +A wrapper around ``ar`` adding the appropriate ``--plugin`` option for the +compiler. + +See also :variable:`CMAKE_AR`. diff --git a/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst b/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst new file mode 100644 index 0000000..945160b --- /dev/null +++ b/Help/variable/CMAKE_LANG_COMPILER_RANLIB.rst @@ -0,0 +1,7 @@ +CMAKE__COMPILER_RANLIB +---------------------------- + +A wrapper around ``ranlib`` adding the appropriate ``--plugin`` option for the +compiler. + +See also :variable:`CMAKE_RANLIB`. diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in index ad65698..7b94d0f 100644 --- a/Modules/CMakeASMCompiler.cmake.in +++ b/Modules/CMakeASMCompiler.cmake.in @@ -1,9 +1,9 @@ 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@") diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in index ab068a2..92afdbb 100644 --- a/Modules/CMakeCCompiler.cmake.in +++ b/Modules/CMakeCCompiler.cmake.in @@ -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) diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index 27c8881..6298189 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -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) diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 7d5e2b2..87c6b28 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -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) diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index c49621b..d521190 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -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@) diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake index 466d4cf..1aa0219 100644 --- a/Modules/Compiler/GNU-FindBinUtils.cmake +++ b/Modules/Compiler/GNU-FindBinUtils.cmake @@ -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} diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake index 4b1c598..0a510f5 100644 --- a/Modules/Compiler/GNU.cmake +++ b/Modules/Compiler/GNU.cmake @@ -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 " + "${CMAKE_${lang}_COMPILER_AR} cr " ) set(CMAKE_${lang}_ARCHIVE_APPEND_IPO - "${CMAKE_GCC_AR} r " + "${CMAKE_${lang}_COMPILER_AR} r " ) set(CMAKE_${lang}_ARCHIVE_FINISH_IPO - "${CMAKE_GCC_RANLIB} " + "${CMAKE_${lang}_COMPILER_RANLIB} " ) endif() endmacro() -- cgit v0.12