mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
commit
93d7a31bda
@ -16,10 +16,13 @@ else()
|
|||||||
message(WARNING ">> IPO disabled. You will not get the best performance.")
|
message(WARNING ">> IPO disabled. You will not get the best performance.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /jumptablerdata /GS-")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /jumptablerdata /GS-")
|
||||||
add_compile_options(/wd4267 /wd4244)
|
add_compile_options(/wd4267 /wd4244)
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox")
|
||||||
@ -54,7 +57,7 @@ endif()
|
|||||||
|
|
||||||
# PK_IS_MAIN determines whether the project is being used from root
|
# PK_IS_MAIN determines whether the project is being used from root
|
||||||
# or if it is added as a dependency (through add_subdirectory for example).
|
# or if it is added as a dependency (through add_subdirectory for example).
|
||||||
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
set(PK_IS_MAIN TRUE)
|
set(PK_IS_MAIN TRUE)
|
||||||
option(PK_BUILD_SHARED_LIB "Build shared library" OFF)
|
option(PK_BUILD_SHARED_LIB "Build shared library" OFF)
|
||||||
option(PK_BUILD_STATIC_LIB "Build static library" OFF)
|
option(PK_BUILD_STATIC_LIB "Build static library" OFF)
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#if PY_SYS_PLATFORM == 0
|
#if PY_SYS_PLATFORM == 0
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
#include <io.h>
|
||||||
|
|
||||||
int platform_chdir(const char* path) { return _chdir(path); }
|
int platform_chdir(const char* path) { return _chdir(path); }
|
||||||
|
|
||||||
@ -244,4 +245,4 @@ void pk__add_module_sys() {
|
|||||||
py_newstr(py_emplacedict(mod, py_name("platform")), PY_SYS_PLATFORM_STRING);
|
py_newstr(py_emplacedict(mod, py_name("platform")), PY_SYS_PLATFORM_STRING);
|
||||||
py_newstr(py_emplacedict(mod, py_name("version")), PK_VERSION);
|
py_newstr(py_emplacedict(mod, py_name("version")), PK_VERSION);
|
||||||
py_newlist(py_emplacedict(mod, py_name("argv")));
|
py_newlist(py_emplacedict(mod, py_name("argv")));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user