From 9301abdf748b54fa3d41375cc4659ca9f4b57dd8 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sat, 18 Feb 2023 17:43:39 +0100 Subject: ci: enable CI_BUILD automatically if environment variable CI is true (#22312) Having to specify CI_BUILD for every CI job requires boilerplate. More importantly, it's easy to forget to enable CI_BUILD, as seen by 8a20f9f98a90a7a43aea08fcde2c40a5356b4f7b. It's simpler to remember to turn CI_BUILD off when a job errors instead of remembering that every new job should have CI_BUILD on. --- src/nvim/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 11f2c3dc6d..7d75b8038e 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -170,7 +170,11 @@ if(HAS_DIAG_COLOR_FLAG) endif() endif() -option(CI_BUILD "CI, extra flags will be set" OFF) +if($ENV{CI}) + option(CI_BUILD "CI, extra flags will be set" ON) +else() + option(CI_BUILD "CI, extra flags will be set" OFF) +endif() if(CI_BUILD) message(STATUS "CI build enabled") if(MSVC) -- cgit