bottlerocket-os / bottlerocket-os/bottlerocket-sdk

`cross_cmake` doesn't respect `CMAKE_BUILD_TYPE` overrides

Open
#314 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
58
Forks
38
Avg merge
5d 20h
Merged PRs (30d)
7

Description

**Image I'm using:**
Bottlerocket SDK 0.65.1

**Issue or Feature Request:**

Packages built with `cross_cmake` can't override `CMAKE_BUILD_TYPE` as the `toolchain.cmake` file takes precedence over `-D` overrides.

I'm trying to overide `CMAKE_BUILD_TYPE` like so:

```bash
%cross_cmake .. \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
# ...some other options
```

I patched the `.cmake` files of the sources I'm trying to build to print the actual value of `CMAKE_BUILD_TYPE` and I saw this message:

```
-- CMAKE_BUILD_TYPE: 'Release'
```

When I remove `set(CMAKE_BUILD_TYPE Release)` from the `toolchain` file, I see:

```
-- CMAKE_BUILD_TYPE: 'RelWithDebInfo'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.