feature add mingw
This commit is contained in:
parent
41663e1c2f
commit
07b150c166
@ -10,11 +10,7 @@ jobs:
|
||||
- Debug
|
||||
- Release
|
||||
toolchain:
|
||||
- hisiv500.toolchain.cmake
|
||||
- himix200.toolchain.cmake
|
||||
- mips64el-linux-gnuabi64.toolchain.cmake
|
||||
- mipsel-openwrt-linux-musl.toolchain.cmake
|
||||
- mipsel-openwrt-linux.toolchain.cmake
|
||||
- mingw-w64-x86_64.toolchain.cmake
|
||||
- host.toolchain.cmake
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
@ -29,3 +25,17 @@ jobs:
|
||||
cd ${{ github.workspace }}/src/grammar
|
||||
java -jar antlr.jar -Dlanguage=Cpp -o ./ ProtoLexer.g4
|
||||
java -jar antlr.jar -Dlanguage=Cpp -o ./ ProtoParser.g4
|
||||
- name: Configure CRPC
|
||||
run: |
|
||||
cd ${{ github.workspace }}
|
||||
cmake . -Bbuild -DCMAKE_TOOLCHAIN_FILE=toolchains/${{ matrix.toolchain }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
|
||||
- name: Build CRPC
|
||||
run: |
|
||||
cmake --build build --config ${{ matrix.build_type }} --target all -- -j `nproc`
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: crpc-${{ matrix.toolchain }}-${{ matrix.build_type }}
|
||||
path: ${{ github.workspace }}/build/crpc
|
||||
|
@ -30,6 +30,9 @@ FILE(GLOB_RECURSE TEST_SRC_LIST ${CMAKE_CURRENT_BINARY_DIR}/grammar/*.c)
|
||||
add_executable(test ${TEST_SRC_LIST}
|
||||
test/test.c
|
||||
)
|
||||
|
||||
target_include_directories(test PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/3party/tpl
|
||||
)
|
||||
)
|
||||
|
||||
INSTALL(TARGETS crpc DESTINATION bin)
|
||||
|
1
main.cpp
1
main.cpp
@ -2,7 +2,6 @@
|
||||
#include <ostream>
|
||||
#include "antlr4-runtime.h"
|
||||
#include "ProtoParserBaseListener.h"
|
||||
#include "ProtoParserBaseVisitor.h"
|
||||
#include "ProtoLexer.h"
|
||||
#include "ProtoParser.h"
|
||||
#include "message.h"
|
||||
|
0
toolchains/host.toolchain.cmake
Normal file
0
toolchains/host.toolchain.cmake
Normal file
17
toolchains/mingw-w64-x86_64.toolchain.cmake
Normal file
17
toolchains/mingw-w64-x86_64.toolchain.cmake
Normal file
@ -0,0 +1,17 @@
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
|
||||
set(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
# cross compilers to use for C, C++ and Fortran
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_Fortran_COMPILER ${TOOLCHAIN_PREFIX}-gfortran)
|
||||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
||||
|
||||
# target environment on the build host system
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
||||
|
||||
# modify default behavior of FIND_XXX() commands
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
Loading…
Reference in New Issue
Block a user