Building a x86 application with CMake, Ninja and Clang on x64 Windows

前端 未结 1 2046
忘掉有多难
忘掉有多难 2020-12-21 13:06

I want to build an x86 Windows application on my x64 Windows machine.

I use CMake, Ninja, clang-cl, lld-link and the VS Build Tools 2017 with the following CMakeList

相关标签:
1条回答
  • 2020-12-21 13:20

    CMake Issue #16259: "Ninja generator fails with clang-cl when mixing 64/32 bit clang and Visual Studio Environment" suggests utilizing environment variables:

    The Ninja generator requires that the environment already be configured for the compiler to produce the desired target. You need to do

    >set CC=clang-cl
    >set CFLAGS=-m32
    >set CXX=clang-cl
    >set CXXFLAGS=-m32
    

    to tell CMake how to invoke the compiler for the desired target.

    0 讨论(0)
提交回复
热议问题