简体   繁体   English

在 gitlab 运行器上更新 cmake 用于 macos

[英]Updating cmake on gitlab runner for macos

I'm using a shell gitlab runner on my macbook.我在我的 macbook 上使用 shell gitlab 跑步者。 It's task is currently to run a very simple yaml file to build my project using cmake.目前的任务是运行一个非常简单的 yaml 文件来使用 cmake 构建我的项目。

build:
    before_script:
        - git submodule update --init --recursive
        - mkdir cmake-build-debug
        - cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" .
    script:
        - cmake --build . --target all -- -j 4

It returns this though: CMake 3.17 or higher is required. You are running version 3.16.3但它会返回: CMake 3.17 or higher is required. You are running version 3.16.3 CMake 3.17 or higher is required. You are running version 3.16.3 . CMake 3.17 or higher is required. You are running version 3.16.3

When I add - which cmake to my before_script, it returns /usr/bin/cmake当我将- which cmake添加到我的 before_script 时,它返回/usr/bin/cmake

When I run ls /usr/bin | grep cmake当我运行ls /usr/bin | grep cmake ls /usr/bin | grep cmake in my terminal, it doesn't return anything. ls /usr/bin | grep cmake在我的终端中,它不返回任何内容。 When I run brew info cmake it returns the version as cmake: stable 3.19.3当我运行brew info cmake它返回版本为cmake: stable 3.19.3

How do I update cmake in my runner?如何在我的跑步者中更新 cmake? Apparently It can't find brew in the before_script either.显然它在 before_script 中也找不到 brew 。

PS: added bonus, if I set the minimum cmake version required to 3.16 it suddenly seems to be unable to link libm PS:额外的好处,如果我将所需的最低 cmake 版本设置为 3.16 它突然似乎无法链接 libm

I forgot to add a tag.我忘了添加标签。 So it wasn't running on my computer but on a different server.所以它不是在我的电脑上运行,而是在不同的服务器上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM