Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer committed Feb 17, 2025
1 parent 331490d commit 4288808
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions CMake/resolve_dependency_modules/gflags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ set(GFLAGS_IS_SUBPROJECT ON)

# Workaround for https://github.com/gflags/gflags/issues/277
unset(BUILD_SHARED_LIBS)
if (DEFINED CACHE{BUILD_SHARED_LIBS})
set(CACHED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
unset(BUILD_SHARED_LIBS CACHE)
endif ()
if(DEFINED CACHE{BUILD_SHARED_LIBS})
set(CACHED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
unset(BUILD_SHARED_LIBS CACHE)
endif()

FetchContent_MakeAvailable(gflags)

# Workaround for https://github.com/gflags/gflags/issues/277
if (DEFINED CACHED_BUILD_SHARED_LIBS AND NOT DEFINED CACHE{BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS ${CACHED_BUILD_SHARED_LIBS} CACHE BOOL "Restored after setting up gflags")
endif ()
if(DEFINED CACHED_BUILD_SHARED_LIBS AND NOT DEFINED CACHE{BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS
${CACHED_BUILD_SHARED_LIBS}
CACHE BOOL "Restored after setting up gflags")
endif()

# This causes find_package(gflags) in other dependencies to search in the build
# directory and prevents the system gflags from being found when they don't use
Expand Down

0 comments on commit 4288808

Please sign in to comment.