Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix MSVC cross compilation#7079

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethomson merged 1 commit intolibgit2:mainfromFaless:fix/static_linker_flags
Jun 4, 2025

Conversation

Faless
Copy link
Contributor

Currently, the DefaultCFlags.cmake overrides the
CMAKE_STATIC_LINKER_FLAGS to suppress linker warnings about files with no symbols defined.

This has the side effect of breaking MSVC cross compilation (where CMAKE_STATIC_LINKER_FLAGS is used to specify the /MACHINE:ARCH flag)

This commit make sure we append to CMAKE_STATIC_LINKER_FLAGS instead of replacing its values

The error when trying to cross compile with MSVC is the following:

[100%] Linking C static library ..\..\git2.libLINK : warning LNK4068: /MACHINE not specified; defaulting to X64..\util\CMakeFiles\util.dir\alloc.c.obj : fatal error LNK1112: module machine type 'ARM64' conflicts with target machine type 'x64'

Currently, the DefaultCFlags.cmake overrides theCMAKE_STATIC_LINKER_FLAGS to suppress linker warnings about files withno symbols defined.This has the side effect of breaking MSVC cross compilation (whereCMAKE_STATIC_LINKER_FLAGS is used to specify the /MACHINE:ARCH flag)This commit make sure we append to CMAKE_STATIC_LINKER_FLAGS instead ofreplacing its values
@ethomson
Copy link
Member

Thanks for the fix!

@ethomsonethomson merged commit488560c intolibgit2:mainJun 4, 2025
19 checks passed
@FalessFaless deleted the fix/static_linker_flags branchJune 4, 2025 10:21
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ethomsonethomsonethomson approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Faless@ethomson

[8]ページ先頭

©2009-2025 Movatter.jp