Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.68 KB

compile_Windows.md

File metadata and controls

54 lines (41 loc) · 1.68 KB

coross compile windows on Ubuntu 18.04 use mingw

  1. Environment setup

    sudo apt install git make autoconf libtool
    sudo apt install g++-mingw-w64-x86-64 gcc-mingw-w64-i686
  2. update cmake https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-Linux-x86_64.sh

  3. selcet posix mingw

    sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
    sudo update-alternatives --config i686-w64-mingw32-g++   
    sudo update-alternatives --config x86_64-w64-mingw32-gcc # Set the default mingw32 gcc compiler option to posix.
    sudo update-alternatives --config i686-w64-mingw32-gcc
  4. download sdl https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz

    edit framework/windows.cmake add /path/to/your/sdl/x86_64-w64-mingw32/lib to COMMON_LIB_DIR add /path/to/your/sdl/x86_64-w64-mingw32/include to COMMON_INC_DIR

  5. build_external

    . setup.env
    cd external/
    ./build_external.sh Windows
  6. build cmdline

    cd cmdline/
    mkdir build
    cd build
    cmake -DCMAKE_TOOLCHAIN_FILE=../cmdline/toolchain.windows.cmake ../
    make cicadaPlayer
  7. copy to windows

    copy the files under to a same dir to windows pc

    • cicadaPlayer.exe in build dir
    • libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll, find it in mingw install dir
    • avcodec-58.dll, avfilter-7.dll, avformat-58.dll,avresample-4.dll, avutil-56.dll, swresample-3.dll, swscale-5.dll, find in external/install/ffmpeg/win32/x86_64/bin/
    • SDL2.dll find in sdl download dir

    double click cicadaPlayer.exe