diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2008-09-22 01:08:49 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2008-09-22 01:08:49 +0000 |
commit | 3d01fc7de86c75926e4e5ac7cc49f0116018893d (patch) | |
tree | 2ea49e2f904dd479a4b941454b776dee762921dd /cmake/modules/CheckCxxHashmap.cmake | |
parent | cd4c73aa708d9ecf5d7e0a711dbf359d22b6dd3a (diff) | |
download | llvm-3d01fc7de86c75926e4e5ac7cc49f0116018893d.tar.gz llvm-3d01fc7de86c75926e4e5ac7cc49f0116018893d.tar.bz2 llvm-3d01fc7de86c75926e4e5ac7cc49f0116018893d.tar.xz |
Initial support for the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/CheckCxxHashmap.cmake')
-rwxr-xr-x | cmake/modules/CheckCxxHashmap.cmake | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/cmake/modules/CheckCxxHashmap.cmake b/cmake/modules/CheckCxxHashmap.cmake new file mode 100755 index 0000000000..5f16c0ac44 --- /dev/null +++ b/cmake/modules/CheckCxxHashmap.cmake @@ -0,0 +1,53 @@ +# - Check if for hash_map. +# CHECK_HASHMAP () +# + +include(CheckCXXSourceCompiles) + +macro(CHECK_HASHMAP) + message(STATUS "Checking for C++ hash_map implementation...") + check_cxx_source_compiles(" + #include <ext/hash_map> + int main() { + __gnu_cxx::hash_map<int, int> t; + } +" + HAVE_GNU_EXT_HASH_MAP + ) + if(HAVE_GNU_EXT_HASH_MAP) + message(STATUS "C++ hash_map found in 'ext' dir in namespace __gnu_cxx::") + endif(HAVE_GNU_EXT_HASH_MAP) + + check_cxx_source_compiles(" + #include <ext/hash_map> + int main() { + std::hash_map<int, int> t; + } +" + HAVE_STD_EXT_HASH_MAP + ) + if(HAVE_STD_EXT_HASH_MAP) + message(STATUS "C++ hash_map found in 'ext' dir in namespace std::") + endif(HAVE_STD_EXT_HASH_MAP) + + check_cxx_source_compiles(" + #include <hash_map> + int main() { + hash_map<int, int> t; + } +" + HAVE_GLOBAL_HASH_MAP + ) + if(HAVE_GLOBAL_HASH_MAP) + message(STATUS "C++ hash_map found in global namespace") + endif(HAVE_GLOBAL_HASH_MAP) + + if(NOT HAVE_GNU_EXT_HASH_MAP) + if(NOT HAVE_STD_EXT_HASH_MAP) + if(NOT HAVE_GLOBAL_HASH_MAP) + message(STATUS "C++ hash_map not found") + endif(NOT HAVE_GLOBAL_HASH_MAP) + endif(NOT HAVE_STD_EXT_HASH_MAP) + endif(NOT HAVE_GNU_EXT_HASH_MAP) + +endmacro(CHECK_HASHMAP) |