Skip to content

Commit

Permalink
cmake: renamed GFLAGS_NAMESPACE to GLOG_GFLAGS_NAMESPACE (#318)
Browse files Browse the repository at this point in the history
This eliminates a conflict between glog and gflags preprocessor definition of GFLAGS_NAMESPACE that can cause the gflags namespace detection to fail (fixes #317).
  • Loading branch information
loop0day authored and sergiud committed Jun 1, 2018
1 parent 2faa186 commit abce788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/DetermineGflagsNamespace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro(determine_gflags_namespace VARIABLE)
int main(int argc, char**argv)
{
GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true);
GLOG_GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true);
}
")
if (NOT CMAKE_REQUIRED_QUIET)
Expand All @@ -33,7 +33,7 @@ int main(int argc, char**argv)
file (WRITE "${_check_file}" "${_check_code}")
try_compile (${VARIABLE}
"${CMAKE_BINARY_DIR}" "${_check_file}"
COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}" -DGFLAGS_NAMESPACE=${_namespace}
COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}" -DGLOG_GFLAGS_NAMESPACE=${_namespace}
LINK_LIBRARIES gflags
CMAKE_FLAGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
OUTPUT_VARIABLE OUTPUT)
Expand Down

0 comments on commit abce788

Please sign in to comment.