Skip to content

Commit

Permalink
mingw, arm64でのビルドを考慮した
Browse files Browse the repository at this point in the history
- experimental
- cmakeビルド時、libs/ で arm64 を考慮するようにした
- ci_scripts を整理した
  • Loading branch information
zmatsuo committed Jul 20, 2024
1 parent 24c5cf4 commit 4c04b9b
Show file tree
Hide file tree
Showing 18 changed files with 247 additions and 191 deletions.
56 changes: 53 additions & 3 deletions ci_scripts/appveyor.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
AppVeyorの使用
==============

git(GitHubも含む)リポジトリからのビルド

## プロジェクト作成 / 設定

- Select repository for your new project
Expand Down Expand Up @@ -61,7 +59,59 @@ appveyor_mix.yml

最近使用していない

## build_local_appveyor_*
build_local_appveyor_*
======================

- ローカルで build_appveyor.bat をテストするための bat ファイル
- Visual Studio と msys2 を使用

ローカルでのテスト(Linux)
=======================

## ビルド準備/WSL

- ストアで debian をインストールする
- 21-05-02時点で debian 10(buster)
- debian を起動
- 次のコマンドを実行

```
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install cmake perl subversion
sudo apt-get -y install g++-mingw-w64
sudo apt-get -y install fp-utils
cd /path/to/teraterm
```

## ビルド準備/debian

- WSLと同じ
- 次のディストリビューション/バージョンに含まれているmingwでのビルドは確認した

```
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
```

## ビルド

gcc 32bit

```
cmake -DCMAKE_GENERATOR="Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../mingw.toolchain.cmake -P buildall.cmake
cmake -P ci_scripts/build_local_appveyor_mingw.cmake
```


gcc 64bit
- `cmake -DCOMPILER_64BIT=ON -P ci_scripts/build_local_appveyor_mingw.cmake`

msys64
- [build_local_appveyor_mingw_cmake.bat](build_local_appveyor_mingw_cmake.bat)参照
56 changes: 0 additions & 56 deletions ci_scripts/appveyor_linux.md

This file was deleted.

8 changes: 7 additions & 1 deletion ci_scripts/build_appveyor.bat
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
cd /d %~dp0..
if exist teraterm\ttpdlg\svnversion.h del teraterm\ttpdlg\svnversion.h
if exist buildtools\svnrev\sourcetree_info.bat del buildtools\svnrev\sourcetree_info.bat
call ci_scripts\install.bat
rem call ci_scripts\install_mycygwin.bat
cd /d %~dp0..
call buildtools\svnrev\svnrev.bat
call buildtools\svnrev\sourcetree_info.bat
echo GENERATOR=%GENERATOR%
echo CMAKE_OPTION_LIBS=%CMAKE_OPTION_LIBS%
echo CMAKE_COMMAND=%CMAKE_COMMAND%
echo BUILD_DIR=%BUILD_DIR%
pause
if "%COMPILER%" == "mingw" (
set PATH=C:\msys64\mingw32\bin;C:\msys64\usr\bin
pacman -S --noconfirm --needed mingw-w64-i686-cmake mingw-w64-i686-gcc make
Expand All @@ -13,6 +18,7 @@ if "%COMPILER%" == "mingw" (
)
set CC=%MINGW_CC%
set CXX=%MINGW_CXX%
set CMAKE=C:\msys64\mingw64\bin\cmake.exe
set CMAKE_OPTION_BUILD=-- -s -j
set CMAKE_OPTION_GENERATE=%CMAKE_OPTION_GENERATE% -DCMAKE_BUILD_TYPE=Release
)
Expand Down
152 changes: 152 additions & 0 deletions ci_scripts/build_local_appveyor.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
@echo off
setlocal
set CUR=%~dp0
cd /d %CUR%

echo =======
echo 1. vs2022 win32
echo 2. vs2022 x64
echo b. vs2022 arm64
echo 3. vs2019 win32
echo 4. vs2019 x64
echo 5. mingw gcc win32
echo 6. mingw gcc x64
echo 7. mingw clang win32
echo 8. mingw clang x64
echo 9. exit
rem echo a. vs2005

if "%1" == "" (
set /p no="select no "
) else (
set no=%1
)
echo %no%

if not "%no%" == "1" goto pass_1
set COMPILER=VS_143
set COMPILER_FRIENDLY=vs2022
set GENERATOR=Visual Studio 17 2022
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=win32
set CMAKE_OPTION_GENERATE=-A Win32
set CMAKE_OPTION_BUILD=--config Release
set BUILD_DIR=build_%COMPILER_FRIENDLY%_win32
call :build
:pass_1
if not "%no%" == "2" goto pass_2
set COMPILER=VS_143_x64
set COMPILER_FRIENDLY=vs2022_x64
set GENERATOR=Visual Studio 17 2022
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=x64
set CMAKE_OPTION_GENERATE=-A x64
set CMAKE_OPTION_BUILD=--config Release
set BUILD_DIR=build_%COMPILER_FRIENDLY%
call :build
:pass_2
if not "%no%" == "b" goto pass_a
set COMPILER=VS_143_arm64
set COMPILER_FRIENDLY=vs2022_arm64
set GENERATOR=Visual Studio 17 2022
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=arm64
set CMAKE_OPTION_GENERATE=-A arm64
set CMAKE_OPTION_BUILD=--config Release
set BUILD_DIR=build_%COMPILER_FRIENDLY%
call :build
:pass_a
if not "%no%" == "3" goto pass_3
set COMPILER=VS_142
set COMPILER_FRIENDLY=vs2019
set GENERATOR=Visual Studio 16 2019
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=win32
set CMAKE_OPTION_GENERATE=-A Win32
set CMAKE_OPTION_BUILD=--config Release
set BUILD_DIR=build_%COMPILER_FRIENDLY%
call :build
:pass_3
if not "%no%" == "4" goto pass_4
set COMPILER=VS_142_x64
set COMPILER_FRIENDLY=vs2019_x64
set GENERATOR=Visual Studio 16 2019
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=x64
set CMAKE_OPTION_GENERATE=-A x64
set CMAKE_OPTION_BUILD=--config Release
set BUILD_DIR=build_%COMPILER_FRIENDLY%
call :build
:pass_4
if not "%no%" == "a" goto pass_a
set COMPILER=VS_80
set COMPILER_FRIENDLY=vs2005
set GENERATOR=Visual Studio 8 2005
set CMAKE_COMMAND=..\libs\cmake-3.11.4-win32-x86\bin\cmake.exe
set CMAKE_OPTION_LIBS=-DARCHITECTURE=win32
set CMAKE_OPTION_GENERATE=
set CMAKE_OPTION_BUILD=--config Release
set BUILD_DIR=build_%COMPILER_FRIENDLY%
:pass_a
if not "%no%" == "5" goto pass_5
set COMPILER=mingw
set COMPILER_FRIENDLY=mingw_gcc
set GENERATOR=Unix Makefiles
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=i686
set CMAKE_OPTION_GENERATE=-DCMAKE_BUILD_TYPE=Release
set CMAKE_OPTION_BUILD=
set MINGW_CC=gcc
set MINGW_CXX=g++
set BUILD_DIR=build_%COMPILER_FRIENDLY%_msys2
call :build
:pass_5
if not "%no%" == "6" goto pass_6
set COMPILER=mingw_x64
set COMPILER_FRIENDLY=mingw_x64_gcc
set GENERATOR=Unix Makefiles
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=x86_64
set CMAKE_OPTION_GENERATE=-DCMAKE_BUILD_TYPE=Release
set CMAKE_OPTION_BUILD=
set MINGW_CC=gcc
set MINGW_CXX=g++
set BUILD_DIR=build_%COMPILER_FRIENDLY%_msys2
call :build
:pass_6
if not "%no%" == "7" goto pass_7
set COMPILER=mingw
set COMPILER_FRIENDLY=mingw_clang
set GENERATOR=Unix Makefiles
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=i686
set CMAKE_OPTION_GENERATE=-DCMAKE_BUILD_TYPE=Release
set CMAKE_OPTION_BUILD=
set MINGW_CC=clang
set MINGW_CXX=clang++
set BUILD_DIR=build_%COMPILER_FRIENDLY%_msys2
call :build
:pass_7
if not "%no%" == "8" goto pass_8
set COMPILER=mingw_x64
set COMPILER_FRIENDLY=mingw_x64_clang
set GENERATOR=Unix Makefiles
set CMAKE_COMMAND=cmake
set CMAKE_OPTION_LIBS=-DARCHITECTURE=x86_64
set CMAKE_OPTION_GENERATE=-DCMAKE_BUILD_TYPE=Release
set CMAKE_OPTION_BUILD=
set MINGW_CC=clang
set MINGW_CXX=clang++
set BUILD_DIR=build_%COMPILER_FRIENDLY%_msys2
call :build
:pass_8

if not "%NOPAUSE%" == "1" pause
exit /b 0

rem ####################
:build
cd /d %~dp0..
call ci_scripts\find_cmake.bat
call ci_scripts\build_appveyor.bat
exit /b 0
14 changes: 0 additions & 14 deletions ci_scripts/build_local_appveyor_mingw_clang.bat

This file was deleted.

14 changes: 0 additions & 14 deletions ci_scripts/build_local_appveyor_mingw_gcc.bat

This file was deleted.

14 changes: 0 additions & 14 deletions ci_scripts/build_local_appveyor_mingw_x64_clang.bat

This file was deleted.

14 changes: 0 additions & 14 deletions ci_scripts/build_local_appveyor_mingw_x64_gcc.bat

This file was deleted.

13 changes: 0 additions & 13 deletions ci_scripts/build_local_appveyor_vs2019.bat

This file was deleted.

13 changes: 0 additions & 13 deletions ci_scripts/build_local_appveyor_vs2019_x64.bat

This file was deleted.

Loading

0 comments on commit 4c04b9b

Please sign in to comment.