Skip to content

doc: Recommend clang-cl when building on Windows #1681

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -604,8 +604,16 @@ jobs:
cpp_flags: '/DSECP256K1_MSVC_MULH_TEST_OVERRIDE'
- job_name: 'x86 (MSVC): Windows (VS 2022)'
cmake_options: '-A Win32'
- job_name: 'x64 (MSVC): Windows (clang-cl)'
cmake_options: '-T ClangCL'
- job_name: 'x64 (clang-cl): Windows (VS 2022, shared)'
cmake_options: '-T ClangCL -DBUILD_SHARED_LIBS=ON'
symbol_check: 'true'
- job_name: 'x64 (clang-cl): Windows (VS 2022, static)'
cmake_options: '-T ClangCL -DBUILD_SHARED_LIBS=OFF'
- job_name: 'x64 (clang-cl): Windows (VS 2022, int128_struct)'
cmake_options: '-T ClangCL -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
- job_name: 'x64 (clang-cl): Windows (VS 2022, int128_struct with __(u)mulh)'
cmake_options: '-T ClangCL -DSECP256K1_TEST_OVERRIDE_WIDE_MULTIPLY=int128_struct'
cpp_flags: '/DSECP256K1_MSVC_MULH_TEST_OVERRIDE'

steps:
- name: Checkout
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,12 @@ To cross compile for Android with [NDK](https://developer.android.com/ndk/guides

To build on Windows with Visual Studio, a proper [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators) must be specified for a new build tree.

Using clang-cl is recommended.
The following example assumes using of Visual Studio 2022 and CMake v3.21+.

In "Developer Command Prompt for VS 2022":

>cmake -G "Visual Studio 17 2022" -A x64 -B build
>cmake -B build -T ClangCL
>cmake --build build --config RelWithDebInfo

Usage examples
Expand Down