mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
use cmake option to support build and cross-build
This commit is contained in:
parent
31f58e9baf
commit
995f674fef
@ -13,9 +13,21 @@ add_executable(pikaByteCodeGen main.c
|
|||||||
${pikascript-core}
|
${pikascript-core}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(pikaByteCodeGen
|
OPTION(CROSS_COMPILE "cross-compile" OFF)
|
||||||
pikabinder
|
IF(CROSS_COMPILE)
|
||||||
)
|
target_link_libraries(pikaByteCodeGen
|
||||||
|
pikabinder
|
||||||
|
ws2_32
|
||||||
|
bcrypt
|
||||||
|
user32
|
||||||
|
userenv
|
||||||
|
)
|
||||||
|
ELSE(CROSS_COMPILE)
|
||||||
|
target_link_libraries(pikaByteCodeGen
|
||||||
|
pikabinder
|
||||||
|
)
|
||||||
|
ENDIF(CROSS_COMPILE)
|
||||||
|
|
||||||
|
|
||||||
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
||||||
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
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)
|
|
@ -1 +1,3 @@
|
|||||||
rm build-win -rf && mkdir build-win && cd build-win && cmake -DCMAKE_TOOLCHAIN_FILE=../CrossCompile.cmake .. && make -j
|
rm build-win -rf && \
|
||||||
|
mkdir build-win && \
|
||||||
|
cd build-win && cmake -DCMAKE_TOOLCHAIN_FILE=../CrossCompile.cmake -DCROSS_COMPILE=ON .. && make -j
|
||||||
|
@ -14,6 +14,6 @@ cp ../../src pikascript/pikascript-core -r
|
|||||||
|
|
||||||
sh cross-win.sh
|
sh cross-win.sh
|
||||||
|
|
||||||
cp pikaByteCodeGen $ROOT/rust-msc-latest-linux
|
cp build-win/pikaByteCodeGen.exe $ROOT/rust-msc-latest-win10.exe
|
||||||
cd $ROOT
|
cd $ROOT
|
||||||
chmod +x rust-msc-latest-linux
|
chmod +x rust-msc-latest-linux
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user