From b06b8c6452f68f4a1da0074d67b195801b23edee Mon Sep 17 00:00:00 2001 From: Raphael Salamon Date: Tue, 16 Jan 2018 22:29:49 +0100 Subject: [PATCH] docs: Document the `main` keyword of the `gtest` framework dependency --- docs/markdown/Dependencies.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/markdown/Dependencies.md b/docs/markdown/Dependencies.md index b36d275fb..189db72e5 100644 --- a/docs/markdown/Dependencies.md +++ b/docs/markdown/Dependencies.md @@ -144,6 +144,13 @@ pass `gtest` or `gmock` to `dependency` and it will do everything for you. If you want to use GMock, it is recommended to use GTest as well, as getting it to work standalone is tricky. +You can set the `main` keyword argument to `true` to use the `main()` +function provided by GTest: +``` +gtest_dep = dependency('gtest', main : true, required : false) +e = executable('testprog', 'test.cc', dependencies : gtest_dep) +test('gtest test', e) +``` ## MPI MPI is supported for C, C++ and Fortran. Because dependencies are