diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-28 23:46:08 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-11-28 23:46:08 +0400 |
commit | 28a2d5e2648c304cd47ce70cf698889cbb87a90f (patch) | |
tree | d455e832615349f69cc787bc02b0435838611fd5 /extern/libmv/third_party/ceres/bundle.sh | |
parent | b7bca8663ac86fbade802ce4d7c835f45bb98807 (diff) |
Code cleanup: spelling fixes and verbosity prints
Diffstat (limited to 'extern/libmv/third_party/ceres/bundle.sh')
-rwxr-xr-x | extern/libmv/third_party/ceres/bundle.sh | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/extern/libmv/third_party/ceres/bundle.sh b/extern/libmv/third_party/ceres/bundle.sh index 906c5d3dd48..750575862de 100755 --- a/extern/libmv/third_party/ceres/bundle.sh +++ b/extern/libmv/third_party/ceres/bundle.sh @@ -177,7 +177,16 @@ endif() include(CheckIncludeFileCXX) CHECK_INCLUDE_FILE_CXX(unordered_map HAVE_STD_UNORDERED_MAP_HEADER) if(HAVE_STD_UNORDERED_MAP_HEADER) - INCLUDE (CheckCXXSourceCompiles) + # Even so we've found unordered_map header file it doesn't + # mean unordered_map and unordered_set will be declared in + # std namespace. + # + # Namely, MSVC 2008 have unordered_map header which declares + # unordered_map class in std::tr1 namespace. In order to support + # this, we do extra check to see which exactly namespace is + # to be used. + + include(CheckCXXSourceCompiles) CHECK_CXX_SOURCE_COMPILES("#include <unordered_map> int main() { std::unordered_map<int, int> map; @@ -186,6 +195,7 @@ if(HAVE_STD_UNORDERED_MAP_HEADER) HAVE_UNURDERED_MAP_IN_STD_NAMESPACE) if(HAVE_UNURDERED_MAP_IN_STD_NAMESPACE) ADD_DEFINITIONS(-DCERES_STD_UNORDERED_MAP) + MESSAGE("-- Found unordered_map/set in std namespace.") else() CHECK_CXX_SOURCE_COMPILES("#include <unordered_map> int main() { @@ -195,9 +205,10 @@ if(HAVE_STD_UNORDERED_MAP_HEADER) HAVE_UNURDERED_MAP_IN_TR1_NAMESPACE) if(HAVE_UNURDERED_MAP_IN_TR1_NAMESPACE) ADD_DEFINITIONS(-DCERES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE) + MESSAGE("-- Found unordered_map/set in std::tr1 namespace.") else() - MESSAGE("-- Found <unordered_map> but can not find neither std::unordered_map " - "nor std::tr1::unordered_map.") + MESSAGE("-- Found <unordered_map> but cannot find either std::unordered_map " + "or std::tr1::unordered_map.") MESSAGE("-- Replacing unordered_map/set with map/set (warning: slower!)") ADD_DEFINITIONS(-DCERES_NO_UNORDERED_MAP) endif() @@ -206,6 +217,7 @@ else() CHECK_INCLUDE_FILE_CXX("tr1/unordered_map" UNORDERED_MAP_IN_TR1_NAMESPACE) if(UNORDERED_MAP_IN_TR1_NAMESPACE) ADD_DEFINITIONS(-DCERES_TR1_UNORDERED_MAP) + MESSAGE("-- Found unordered_map/set in std::tr1 namespace.") else() MESSAGE("-- Unable to find <unordered_map> or <tr1/unordered_map>. ") MESSAGE("-- Replacing unordered_map/set with map/set (warning: slower!)") @@ -248,16 +260,28 @@ if env['WITH_BF_OPENMP']: conf = Configure(env) if conf.CheckCXXHeader("unordered_map"): + # Even so we've found unordered_map header file it doesn't + # mean unordered_map and unordered_set will be declared in + # std namespace. + # + # Namely, MSVC 2008 have unordered_map header which declares + # unordered_map class in std::tr1 namespace. In order to support + # this, we do extra check to see which exactly namespace is + # to be used. + if conf.CheckType('std::unordered_map<int, int>', language = 'CXX', includes="#include <unordered_map>"): defs.append('CERES_STD_UNORDERED_MAP') + print("-- Found unordered_map/set in std namespace.") elif conf.CheckType('std::tr1::unordered_map<int, int>', language = 'CXX', includes="#include <unordered_map>"): defs.append('CERES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE') + print("-- Found unordered_map/set in std::tr1 namespace.") else: print("-- Found <unordered_map> but can not find neither std::unordered_map nor std::tr1::unordered_map.") print("-- Replacing unordered_map/set with map/set (warning: slower!)") defs.append('CERES_NO_UNORDERED_MAP') elif conf.CheckCXXHeader("tr1/unordered_map"): defs.append('CERES_TR1_UNORDERED_MAP') + print("-- Found unordered_map/set in std::tr1 namespace.") else: print("-- Unable to find <unordered_map> or <tr1/unordered_map>. ") print("-- Replacing unordered_map/set with map/set (warning: slower!)") |