从 bii 传递 cmake 命令行选项
Passing cmake command-line options from bii
如何将命令行选项从 bii 传递给 cmake?我试过像这样传递 -Wdev
和 --debug-output
:
bii build -Wdev --debug-output
但它不起作用:
INFO: Processing changes...
Building: "cmake" --build . -Wdev --debug-output
Unknown argument -Wdev
Unknown argument --debug-output
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Ignored. Behavior is default in CMake >= 3.0.
-- = Pass remaining options to the native tool.
ERROR: Build failed
bii build
命令不调用 cmake 项目配置,它调用 cmake --build
(您可以在输出中看到它),后者依次运行底层构建系统、make、MSBuild ...
在调用 bii build 之前,可以将这些选项传递给 bii configure 命令。尝试:
$ bii configure -Wdev --debug-output
您可能会在控制台输出中看到如下内容:
Running: "C:/.../.biicode/cmake-3.2.2-win32-x86/bin\cmake" -G "MinGW Makefiles" -Wno-dev -Wdev --debug-output ..\cmake
Running with debug output on.
BLOCK: diego/prueba
Called from: [1] C:/.../prueba/bii/cmake/CMakeLists.txt
-----------------------------------------------------------
Called from: [1] C:/.../prueba/bii/cmake/CMakeLists.txt
这表明它正在工作。默认情况下 bii 将 -Wno-dev 添加到配置选项中,但是由于用户选项(在本例中为 -Wdev)稍后出现,cmake 保持最新,因此它也可以工作。
如何将命令行选项从 bii 传递给 cmake?我试过像这样传递 -Wdev
和 --debug-output
:
bii build -Wdev --debug-output
但它不起作用:
INFO: Processing changes...
Building: "cmake" --build . -Wdev --debug-output
Unknown argument -Wdev
Unknown argument --debug-output
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Ignored. Behavior is default in CMake >= 3.0.
-- = Pass remaining options to the native tool.
ERROR: Build failed
bii build
命令不调用 cmake 项目配置,它调用 cmake --build
(您可以在输出中看到它),后者依次运行底层构建系统、make、MSBuild ...
在调用 bii build 之前,可以将这些选项传递给 bii configure 命令。尝试:
$ bii configure -Wdev --debug-output
您可能会在控制台输出中看到如下内容:
Running: "C:/.../.biicode/cmake-3.2.2-win32-x86/bin\cmake" -G "MinGW Makefiles" -Wno-dev -Wdev --debug-output ..\cmake
Running with debug output on.
BLOCK: diego/prueba
Called from: [1] C:/.../prueba/bii/cmake/CMakeLists.txt
-----------------------------------------------------------
Called from: [1] C:/.../prueba/bii/cmake/CMakeLists.txt
这表明它正在工作。默认情况下 bii 将 -Wno-dev 添加到配置选项中,但是由于用户选项(在本例中为 -Wdev)稍后出现,cmake 保持最新,因此它也可以工作。