diff options
-rw-r--r-- | googletest/docs/pkgconfig.md | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/googletest/docs/pkgconfig.md b/googletest/docs/pkgconfig.md index d5f3614..117166c 100644 --- a/googletest/docs/pkgconfig.md +++ b/googletest/docs/pkgconfig.md @@ -143,8 +143,8 @@ pkg-config will also try to look in `PKG_CONFIG_PATH` to find `gtest_main.pc`. ### Using pkg-config in a cross-compilation setting Pkg-config can be used in a cross-compilation setting too. To do this, let's -assume the final prefix of the cross-compiled installation will be `/usr`, -and your sysroot is `/home/MYUSER/sysroot`. Configure and install GTest using +assume the final prefix of the cross-compiled installation will be `/usr`, and +your sysroot is `/home/MYUSER/sysroot`. Configure and install GTest using ``` mkdir build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. @@ -164,9 +164,9 @@ export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=yes export PKG_CONFIG_ALLOW_SYSTEM_LIBS=yes ``` -otherwise `pkg-config` will filter `-I` and `-L` flags against standard -prefixes such as `/usr` (see https://bugs.freedesktop.org/show_bug.cgi?id=28264#c3 -for reasons why this stripping needs to occur usually). +otherwise `pkg-config` will filter `-I` and `-L` flags against standard prefixes +such as `/usr` (see https://bugs.freedesktop.org/show_bug.cgi?id=28264#c3 for +reasons why this stripping needs to occur usually). If you look at the generated pkg-config file, it will look something like @@ -182,8 +182,8 @@ Libs: -L${libdir} -lgtest -lpthread Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -lpthread ``` -Notice that the sysroot is not included in `libdir` and `includedir`! If you -try to run `pkg-config` with the correct +Notice that the sysroot is not included in `libdir` and `includedir`! If you try +to run `pkg-config` with the correct `PKG_CONFIG_LIBDIR=/home/MYUSER/sysroot/usr/lib64/pkgconfig` against this `.pc` file, you will get @@ -194,10 +194,10 @@ $ pkg-config --libs gtest -L/usr/lib64 -lgtest -lpthread ``` -which is obviously wrong and points to the `CBUILD` and not `CHOST` root. -In order to use this in a cross-compilation setting, we need to tell -pkg-config to inject the actual sysroot into `-I` and `-L` variables. Let us -now tell pkg-config about the actual sysroot +which is obviously wrong and points to the `CBUILD` and not `CHOST` root. In +order to use this in a cross-compilation setting, we need to tell pkg-config to +inject the actual sysroot into `-I` and `-L` variables. Let us now tell +pkg-config about the actual sysroot ``` export PKG_CONFIG_DIR= @@ -214,6 +214,6 @@ $ pkg-config --libs gtest -L/home/MYUSER/sysroot/usr/lib64 -lgtest -lpthread ``` -which contains the correct sysroot now. For a more comprehensive guide to -also including `${CHOST}` in build system calls, see the excellent tutorial -by Diego Elio Pettenò: https://autotools.io/pkgconfig/cross-compiling.html +which contains the correct sysroot now. For a more comprehensive guide to also +including `${CHOST}` in build system calls, see the excellent tutorial by Diego +Elio Pettenò: https://autotools.io/pkgconfig/cross-compiling.html |