Skip to content

cmake: set BUILD_ARCH with CMAKE_HOST_SYSTEM_PROCESSOR - #7369

Merged
nilason merged 6 commits into
OSGeo:mainfrom
nilason:cmake_rm_custom_host_arch
Sep 25, 2026
Merged

nilason merged 6 commits into
OSGeo:mainfrom
nilason:cmake_rm_custom_host_arch

Conversation

@nilason

@nilason nilason commented May 6, 2026

Copy link
Copy Markdown
Contributor

Set BUILD_ARCH with CMAKE_HOST_SYSTEM_PROCESSOR and remove custom function get_host_arch.

I see no reason to not use CMake's variable for setting this, after all that is deciding what/how to build anyway. The custom function requires maintenance, macOS is currently not supported and defaults to x86_64.

The only effect this has is the build_platform output of g.version -g. Otherwise BUILD_ARCH is mainly a remnant of Autotools builds, where build output directory is named after Autotool's host variable (e.g. dist.aarch64-apple-darwin25.3.0; note: this is not the same as just uname -m) and this is passed to various Python build scripts, in CMake it doesn't play any role.

Remove custom function 'get_host_arch'.
@nilason nilason added this to the 8.5.0 milestone May 6, 2026
@nilason nilason added the backport to 8.5 PR needs to be backported to release branch 8.5 label May 6, 2026
@github-actions github-actions Bot added the CMake label May 6, 2026
@nilason
nilason requested a review from HuidaeCho May 6, 2026 12:53
@wenzeslaus wenzeslaus modified the milestones: 8.5.0, 8.5.1 May 8, 2026
Comment thread CMakeLists.txt Resolved

@wenzeslaus wenzeslaus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to CMAKE_SYSTEM_PROCESSOR because the idea of build_platform where this is used seems to be "platform it is build for", not "platform it was build on".

Comment thread CMakeLists.txt Resolved
Comment thread CMakeLists.txt Resolved
@echoix echoix added the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Jul 17, 2026
@echoix echoix removed the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Jul 17, 2026
Use CMAKE_SYSTEM_PROCESSOR and CMAKE_SYSTEM_NAME
(and CMAKE_SYSTEM_VERSION if set).
@echoix echoix added the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Sep 5, 2026
@echoix

echoix commented Sep 5, 2026

Copy link
Copy Markdown
Member

There's conflicts to solve

@nilason nilason removed the conflicts/needs rebase Rebase to or merge with the latest base branch is needed label Sep 5, 2026
@nilason

nilason commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

There's conflicts to solve

Thanks for the heads-up, fixed.

@echoix echoix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, and there is still the grass --config arch to fix by using https://github.com/OSGeo/grass/blob/main/python/grass/app/resource_paths.py, as your comment #7369 (comment)

This should still be merged though, maybe track an issue in order to not forget to do that?

@nilason

nilason commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Looks good now, and there is still the grass --config arch to fix by using https://github.com/OSGeo/grass/blob/main/python/grass/app/resource_paths.py, as your comment #7369 (comment)

This should still be merged though, maybe track an issue in order to not forget to do that?

It is done with #7875

@echoix
echoix requested a review from wenzeslaus September 5, 2026 16:05
@nilason

nilason commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

@wenzeslaus please take a look at this, your requested change is blocking this from merging.

@nilason
nilason dismissed wenzeslaus’s stale review September 25, 2026 14:25

Implemented changes, let’s move forward.

@nilason
nilason merged commit 4921fe4 into OSGeo:main Sep 25, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport to 8.5 PR needs to be backported to release branch 8.5 CMake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants