check_include_file_cxx ("${fname}.h" HAVE_${FNAME}_H)
endif ()
endforeach ()
- # the following are used in #if not #ifdef
+ # the following are used in #if directives not #ifdef
bool_to_int (HAVE_STDINT_H)
bool_to_int (HAVE_SYS_TYPES_H)
bool_to_int (HAVE_INTTYPES_H)
set (LIB_TARGETS)
if (BUILD_gflags_LIB)
add_library (gflags ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
+ if (HAVE_SHLWAPI_H)
+ target_link_libraries (gflags shlwapi.lib)
+ endif ()
list (APPEND LIB_TARGETS gflags)
endif ()
if (BUILD_gflags_nothreads_LIB)
add_library (gflags_nothreads ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
set_target_properties (gflags_nothreads PROPERTIES COMPILE_DEFINITIONS NO_THREADS)
+ if (HAVE_SHLWAPI_H)
+ target_link_libraries (gflags_nothreads shlwapi.lib)
+ endif ()
list (APPEND LIB_TARGETS gflags_nothreads)
endif ()
#include <errno.h>
#if defined(HAVE_FNMATCH_H)
# include <fnmatch.h>
-#elif defined(_MSC_VER) && defined(HAVE_SHLWAPI_H)
+#elif defined(HAVE_SHLWAPI_H)
# include <shlwapi.h>
-# pragma comment(lib, "shlwapi.lib")
#endif
#include <stdarg.h> // For va_list and related operations
#include <stdio.h>
#if defined(HAVE_FNMATCH_H)
|| fnmatch(glob.c_str(), ProgramInvocationName(), FNM_PATHNAME) == 0
|| fnmatch(glob.c_str(), ProgramInvocationShortName(), FNM_PATHNAME) == 0
-#elif defined(_MSC_VER) && defined(HAVE_SHLWAPI_H)
+#elif defined(HAVE_SHLWAPI_H)
|| PathMatchSpec(glob.c_str(), ProgramInvocationName())
|| PathMatchSpec(glob.c_str(), ProgramInvocationShortName())
#endif
-1.0);
}
-#if defined(HAVE_FNMATCH_H) || (defined(_MSC_VER) && defined(HAVE_SHLWAPI_H)) // otherwise glob isn't supported
+#if defined(HAVE_FNMATCH_H) || defined(HAVE_SHLWAPI_H) // otherwise glob isn't supported
TEST(FlagFileTest, FilenamesOurfileGlob) {
FLAGS_test_string = "initial";
FLAGS_test_bool = false;
1,
-1.0);
}
-#endif // defined(HAVE_FNMATCH_H) || (defined(_MSC_VER) && defined(HAVE_SHLWAPI_H))
+#endif // defined(HAVE_FNMATCH_H) || defined(HAVE_SHLWAPI_H)
// Tests that a failed flag-from-string read keeps flags at default values
TEST(FlagFileTest, FailReadFlagsFromString) {