build on windows is ok

This commit is contained in:
lyon 2022-05-05 20:26:03 +08:00
parent 8c48a8f720
commit 1fc5a9194a
3 changed files with 30 additions and 3 deletions

View File

@ -13,7 +13,7 @@ add_executable(pikaByteCodeGen main.c
${pikascript-core}
)
target_link_libraries(pikaByteCodeGen
target_link_libraries(pikaByteCodeGen
pikabinder
)

View File

@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.0.0)
project(pikaByteCodeGen VERSION 0.1.0)
include(CTest)
enable_testing()
aux_source_directory(pikascript/pikascript-core pikascript-core)
include_directories(pikascript/pikascript-core)
include_directories(libpikabinder)
link_directories(libpikabinder)
add_executable(pikaByteCodeGen main.c
${pikascript-core}
)
target_link_libraries(pikaByteCodeGen
bcrypt
user32
userenv
ws2_32
wsock32
pikabinder
)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

View File

@ -4,9 +4,9 @@ ROOT=$PWD
rm libpikabinder -rf
mkdir libpikabinder
cargo build --release --target=x86_64-pc-windows-gnu
cargo build --release --target=i686-pc-windows-gnu
cbindgen --config cbindgen.toml --crate rust-msc --output libpikabinder/libpikabinder.h
cp target/x86_64-pc-windows-gnu/release/libpikabinder.a libpikabinder
cp target/i686-pc-windows-gnu/release/libpikabinder.a libpikabinder
cd ../pikaByteCodeGen
cp ../pikaCompiler/libpikabinder . -r