Skip to content

Commit

Permalink
Merge pull request #16 from karoterra/refactor/build-system
Browse files Browse the repository at this point in the history
ビルド関連の設定を更新
  • Loading branch information
karoterra authored May 12, 2024
2 parents e510a40 + 8eb1c7c commit e474f8a
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 20 deletions.
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
charset = utf-8

[*.{c,cpp,h,hpp}]
charset = cp932
[*.{yml,yaml}]
indent_size = 2
5 changes: 0 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
* text=auto

*.h text working-tree-encoding=cp932
*.c text working-tree-encoding=cp932
*.hpp text working-tree-encoding=cp932
*.cpp text working-tree-encoding=cp932
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Windows Plugin

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up MSVC
uses: microsoft/setup-msbuild@v2

- name: Configure CMake
run: cmake --preset default

- name: Build
run: cmake --build build --preset release

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aviutl_ShowLimit
path: build/Release/ShowLimit.auf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Bb]uild/
[Vv]endor/
*.auf
CMakeUserPresets.json

# User-specific files
*.rsuser
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendor/aviutl_exedit_sdk"]
path = vendor/aviutl_exedit_sdk
url = https://github.com/ePi5131/aviutl_exedit_sdk
6 changes: 0 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
{
"[c]": {
"files.encoding": "shiftjis"
},
"[cpp]": {
"files.encoding": "shiftjis"
}
}
33 changes: 33 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "CMake: Build (Debug)",
"command": "cmake",
"args": [
"--build",
"${workspaceFolder}/build",
"--preset",
"debug"
],
"group": "build",
"problemMatcher": [],
"detail": "デバッグビルド"
},
{
"type": "shell",
"label": "CMake: Build (Release)",
"command": "cmake",
"args": [
"--build",
"${workspaceFolder}/build",
"--preset",
"release"
],
"group": "build",
"problemMatcher": [],
"detail": "リリースビルド"
}
]
}
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.21)
project(aviutl_ShowLimit)

set(AVIUTL_INCLUDE_DIR "vendor" CACHE PATH "AviUtl Plugin SDK include dir")

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand All @@ -20,8 +18,12 @@ add_library(ShowLimit SHARED
src/LanguagePlugin.hpp
)
target_include_directories(ShowLimit PRIVATE
${AVIUTL_INCLUDE_DIR}
${AVIUTL_INCLUDE_DIR}/aviutl_exedit_sdk
vendor/aviutl_exedit_sdk
)
target_link_libraries(ShowLimit comctl32 bcrypt)
target_compile_options(ShowLimit
PRIVATE
"$<$<CXX_COMPILER_ID:MSVC>:/source-charset:utf-8>"
"$<$<CXX_COMPILER_ID:MSVC>:/execution-charset:shift_jis>"
)
set_target_properties(ShowLimit PROPERTIES SUFFIX .auf)
23 changes: 23 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": 3,
"configurePresets": [
{
"name": "default",
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 17 2022",
"architecture": "Win32"
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "default",
"configuration": "Debug"
},
{
"name": "release",
"configurePreset": "default",
"configuration": "Release"
}
]
}
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Credits

## aviutl_exedit_sdk v1
## aviutl_exedit_sdk v1.2

https://github.com/ePi5131/aviutl_exedit_sdk

Expand Down
1 change: 1 addition & 0 deletions vendor/aviutl_exedit_sdk
Submodule aviutl_exedit_sdk added at 834536

0 comments on commit e474f8a

Please sign in to comment.