From 8411df715cf522606e3b1aca386ddfc0b63d34b4 Mon Sep 17 00:00:00 2001
From: Andreas Schuh To use an external gflags installation, add the following CMake code to your Find gflags installation. The CMakeLists.txt
file.gflags_DIR
variable must be set to the <prefix>/lib/cmake/gflags directory
@@ -143,7 +143,7 @@ any installation of the gflags subproject products.
add_executable(foo main.cc) - target_link_libraries(foo gflags) + target_link_libraries(foo gflags::gflags)
WORKSPACE
file
git_repository( - name = "com_github_gflags_gflags", - commit = "<INSERT COMMIT SHA HERE>", + name = "com_github_gflags_gflags", remote = "https://github.com/gflags/gflags.git", + tags = "v2.2.2" )
You can then add @com_github_gflags_gflags//:gflags
to the deps
section of a
cc_binary
or cc_library
rule, and #include "gflags/gflags.h"
to
-include it in your source code. This use the shared gflags library with multi-threading enabled.
+include it in your source code. This uses the shared gflags library with multi-threading enabled.
In order to use the single-threaded shared gflags library, use the dependency
@com_github_gflags_gflags//:gflags_nothreads
instead.