diff --git a/tools/pikaByteCodeGen/CMakeLists.txt b/tools/pikaByteCodeGen/CMakeLists.txt index 86bcb8c0f..377fd7af5 100644 --- a/tools/pikaByteCodeGen/CMakeLists.txt +++ b/tools/pikaByteCodeGen/CMakeLists.txt @@ -13,9 +13,21 @@ add_executable(pikaByteCodeGen main.c ${pikascript-core} ) -target_link_libraries(pikaByteCodeGen - pikabinder - ) +OPTION(CROSS_COMPILE "cross-compile" OFF) +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_VERSION ${PROJECT_VERSION}) diff --git a/tools/pikaByteCodeGen/cmake-win/CMakeLists.txt b/tools/pikaByteCodeGen/cmake-win/CMakeLists.txt deleted file mode 100644 index 602f5b928..000000000 --- a/tools/pikaByteCodeGen/cmake-win/CMakeLists.txt +++ /dev/null @@ -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) diff --git a/tools/pikaByteCodeGen/cross-win.sh b/tools/pikaByteCodeGen/cross-win.sh index 844c5ffd4..eb9c9c100 100644 --- a/tools/pikaByteCodeGen/cross-win.sh +++ b/tools/pikaByteCodeGen/cross-win.sh @@ -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 diff --git a/tools/pikaCompiler/cross-build.sh b/tools/pikaCompiler/cross-build.sh index ed4cc2fa9..ca51d0e26 100644 --- a/tools/pikaCompiler/cross-build.sh +++ b/tools/pikaCompiler/cross-build.sh @@ -14,6 +14,6 @@ cp ../../src pikascript/pikascript-core -r sh cross-win.sh -cp pikaByteCodeGen $ROOT/rust-msc-latest-linux +cp build-win/pikaByteCodeGen.exe $ROOT/rust-msc-latest-win10.exe cd $ROOT chmod +x rust-msc-latest-linux diff --git a/tools/pikaCompiler/rust-msc-latest-win10.exe b/tools/pikaCompiler/rust-msc-latest-win10.exe index f5293014b..807c8c1cd 100644 Binary files a/tools/pikaCompiler/rust-msc-latest-win10.exe and b/tools/pikaCompiler/rust-msc-latest-win10.exe differ