Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake(): allow setting HOST_CPU for cross-compilation #3327

Merged
merged 2 commits into from
Jul 19, 2021

Commits on Jul 19, 2021

  1. cmake(): allow setting HOST_CPU for cross-compilation

    Git's regular Makefile mentions that HOST_CPU should be defined when cross-compiling Git: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/Makefile#L438-L439
    
    This is then used to set the GIT_HOST_CPU variable when compiling Git: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/Makefile#L1337-L1341
    
    Then, when the user runs `git version --build-options`, it returns that value: https://github.com/git-for-windows/git/blob/37796bca76ef4180c39ee508ca3e42c0777ba444/help.c#L658
    
    This commit adds the same functionality to the CMake configuration. Users can now set -DHOST_CPU= to set the target architecture.
    
    Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
    dennisameling committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    390bf68 View commit details
    Browse the repository at this point in the history
  2. ci(): add HOST_CPU to CMake command

    As mentioned in the Makefile and CMakeLists.txt: "When cross-compiling, define HOST_CPU as the canonical name of the CPU on which the built Git will run (for instance "x86_64")"
    
    This commit sets the HOST_CPU variable since Git for Windows arm64 is cross-compiled from an amd64 host.
    
    Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
    dennisameling committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    cc48a7e View commit details
    Browse the repository at this point in the history