summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Compiler')
-rw-r--r--Modules/Compiler/GNU-CXX.cmake3
-rw-r--r--Modules/Compiler/GNU-FindBinUtils.cmake25
2 files changed, 26 insertions, 2 deletions
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index c007c98..2499d2f 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -11,8 +11,7 @@ else()
endif()
endif()
-if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
- # Supported since 4.3
+if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
endif()
diff --git a/Modules/Compiler/GNU-FindBinUtils.cmake b/Modules/Compiler/GNU-FindBinUtils.cmake
new file mode 100644
index 0000000..466d4cf
--- /dev/null
+++ b/Modules/Compiler/GNU-FindBinUtils.cmake
@@ -0,0 +1,25 @@
+if(NOT DEFINED _CMAKE_PROCESSING_LANGUAGE OR _CMAKE_PROCESSING_LANGUAGE STREQUAL "")
+ message(FATAL_ERROR "Internal error: _CMAKE_PROCESSING_LANGUAGE is not set")
+endif()
+
+string(REGEX MATCH "^([0-9]+\\.[0-9]+)" __version_x_y
+ "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_VERSION}")
+
+# Try to find tools in the same directory as GCC itself
+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
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar"
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar-${__version_x_y}"
+ HINTS ${__gcc_hints}
+ DOC "A wrapper around 'ar' adding the appropriate '--plugin' option for the GCC compiler"
+)
+
+# http://manpages.ubuntu.com/manpages/wily/en/man1/gcc-ranlib.1.html
+find_program(CMAKE_GCC_RANLIB NAMES
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib"
+ "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib-${__version_x_y}"
+ HINTS ${__gcc_hints}
+ DOC "A wrapper around 'ranlib' adding the appropriate '--plugin' option for the GCC compiler"
+)