githubcmakewxwidgetsgithub-ci

Cmake actions build for Windows x86


I have a Cmake/wxWidgets project that builds fine on my pc. I compile wxWidgets using nmake /f makefile.vc BUILD=release TARGET_CPU=X86 and generate the CMake project using cmake .. -G "Visual Studio 16 2019" -A Win32 -DCMAKE_CONFIGURATION_TYPES=Release.

Like I wrote, this compiles fine on my pc. When I want to build it using a github action on Windows 2019 Image I first pull wxWidgets, compile it using the above statement, generate wxWidgets using the aboce statement and trigger the build using a cmd-script containing "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" ".\build\NaCl-Configurator.sln" /p:Configuration=Release /p:Platform=Win32 /p:PlatformTarget=x86

But when doing this I always get the following error:

  wxmsw31u_core.lib(corelib_wincmn.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86' [D:\a\abc\abc\build\abc.vcxproj]

If I switch everything to x64 it compiles fine, but I need a x86 build. Is there any system setting I'm missing?


Solution

  • I was using another github action to access nmake to build wxWidgets. Within this action I had to specify the architecture. So using

          - name: Preparing nmake    
            uses: ilammy/msvc-dev-cmd@v1
            with:
              arch: x86
          - name: start building wx widgtes
            run: |
              cd ${{ env.WXWIN }}${{ env.wxMSW_VER }}\build\msw
              nmake /f makefile.vc BUILD=release TARGET_CPU=X86
    

    and then going on did the trick. It was only the with: arch: x86 that was missing