From fc2bce54c73477ae20e8c80b2952819985ddf673 Mon Sep 17 00:00:00 2001 From: scivision Date: Sat, 11 May 2024 22:55:46 -0400 Subject: [PATCH] Help: try_compile how to pass compiler options it wasn't obvious how to pass compiler options. Since the old add_definitions() is used we can workaround this by passing compiler options there. --- Help/command/try_compile.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst index 5021851be3..9ee1d016ac 100644 --- a/Help/command/try_compile.rst +++ b/Help/command/try_compile.rst @@ -156,8 +156,9 @@ The options for the above signatures are: Specify flags of the form :option:`-DVAR:TYPE=VALUE ` to be passed to the :manual:`cmake(1)` command-line used to drive the test build. The above example shows how values for variables - ``INCLUDE_DIRECTORIES``, ``LINK_DIRECTORIES``, and ``LINK_LIBRARIES`` - are used. + ``COMPILE_DEFINITIONS``, ``INCLUDE_DIRECTORIES``, ``LINK_DIRECTORIES``, + ``LINK_LIBRARIES``, and ``LINK_OPTIONS`` are used. Compiler options + can be passed in like `CMAKE_FLAGS -DCOMPILE_DEFINITIONS=-Werror`. ``COMPILE_DEFINITIONS ...`` Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions`