Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration for GitHub Actions #4

Merged
merged 4 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/ccpp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: C/C++ CI

on:
push:
branches: [ '1.10' ]
pull_request:
branches: [ '1.10' ]

jobs:
build:
strategy:
matrix:
build_type: [ Release ]
config:
- os: ubuntu-latest
cc: gcc
cxx: g++
config_generator_type: single
- os: ubuntu-latest
cc: clang
cxx: clang++
config_generator_type: single
- os: macos-latest
cc: gcc
cxx: g++
config_generator_type: single
- os: macos-latest
cc: clang
cxx: clang++
config_generator_type: single
- os: windows-latest
cc: cl
cxx: cl
config_generator_type: multiple
r9y9 marked this conversation as resolved.
Show resolved Hide resolved

runs-on: ${{ matrix.config.os }}

env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}

steps:
- uses: actions/checkout@v2
with:
repository: r9y9/hts_engine_API
path: hts_engine_API
- name: Build hts_engine_API
working-directory: ./hts_engine_API/src
run: |
cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=ON -S . -B build
cmake --build build --config ${{ matrix.build_type }}
- name: Library Path
id: library_path
uses: haya14busa/action-cond@v1
with:
cond: ${{ matrix.config.config_generator_type == 'multiple' }}
if_true: ../../hts_engine_API/src/build/lib/${{ matrix.build_type }}
if_false: ../../hts_engine_API/src/build/lib
- uses: actions/checkout@v2
with:
path: open_jtalk
- name: Build open_jtalk
working-directory: ./open_jtalk/src
run: |
cmake -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -D BUILD_SHARED_LIBS=ON -D CMAKE_INCLUDE_PATH=../../hts_engine_API/src/include -D CMAKE_LIBRARY_PATH=${{ steps.library_path.outputs.value }} -S . -B build
cmake --build build --config ${{ matrix.build_type }}
10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/times.h HAVE_SYS_TIMES_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(unistd.h HAVE_UNISTD_H)
check_include_files(windows.h HAVE_WINDOWS_H)
check_function_exists(getenv HAVE_GETENV)
check_function_exists(getpagesize HAVE_GETPAGESIZE)
check_function_exists(mmap HAVE_MMAP)
Expand Down Expand Up @@ -116,13 +117,22 @@ if(${CHARSET} STREQUAL "sjis")
foreach(flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
set(${flag} "${${flag}} -finput-charset=cp932 -fexec-charset=cp932")
endforeach()
target_compile_options(openjtalk
PRIVATE $<$<C_COMPILER_ID:MSVC>:/source-charset:.932;/execution-charset:.932>
)
elseif(${CHARSET} STREQUAL "eucjp")
add_definitions(-DCHARSET_EUC_JP -DMECAB_CHARSET=euc-jp)
target_compile_options(openjtalk
PRIVATE $<$<C_COMPILER_ID:MSVC>:/source-charset:euc-jp;/execution-charset:euc-jp>
)
elseif(${CHARSET} STREQUAL "utf8")
add_definitions(-DCHARSET_UTF_8 -DMECAB_CHARSET=utf-8 -DMECAB_UTF8_USE_ONLY)
foreach(flag CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
set(${flag} "${${flag}} -finput-charset=UTF-8 -fexec-charset=UTF-8")
endforeach()
target_compile_options(openjtalk
PRIVATE $<$<C_COMPILER_ID:MSVC>:/source-charset:UTF-8;/execution-charset:UTF-8>
)
else()
message(FATAL_ERROR "Encoding ${CHARSET} not recognized. You can set sjis/eucjp/utf8")
endif()
Expand Down