fix cross build

This commit is contained in:
lyon 2023-02-14 11:37:28 +08:00
parent 4fb1fd3ed4
commit dacf1584e4
3 changed files with 6 additions and 3 deletions

View File

@ -28,7 +28,7 @@
#include "PikaPlatform.h"
#include <stdio.h>
#include <stdlib.h>
#ifdef WIN32
#if defined(_WIN32) && !defined(CROSS_BUILD)
#include <Windows.h>
#endif
@ -307,7 +307,7 @@ PIKA_WEAK void pika_platform_thread_delay(void) {
PIKA_WEAK void pika_platform_sleep_ms(uint32_t ms) {
#if defined(__linux)
usleep(ms * 1000);
#elif defined(_WIN32)
#elif defined(_WIN32) && !defined(CROSS_BUILD)
Sleep(ms);
#else
pika_platform_printf(

View File

@ -3,7 +3,10 @@ project(pikaByteCodeGen VERSION 0.1.0)
include(CTest)
enable_testing()
ADD_DEFINITIONS(-DPIKA_CONFIG_ENABLE)
ADD_DEFINITIONS(
-DPIKA_CONFIG_ENABLE
-DCROSS_BUILD
)
aux_source_directory(pikascript/pikascript-core pikascript-core)
aux_source_directory(pikascript/pikascript-lib/PikaStdLib PikaStdLib)
aux_source_directory(pikascript/pikascript-api pikascript-api)