diff --git a/CMakeLists.txt b/CMakeLists.txt index 13f22441..53751722 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,12 @@ else() add_definitions(-DPK_ENABLE_THREADS=0) endif() +if(PK_ENABLE_DLL) + add_definitions(-DPK_ENABLE_DLL=1) +else() + add_definitions(-DPK_ENABLE_DLL=0) +endif() + if(PK_ENABLE_DETERMINISM) add_definitions(-DPK_ENABLE_DETERMINISM=1) else() @@ -154,7 +160,7 @@ if(PK_ENABLE_THREADS) endif() if(UNIX AND NOT APPLE) - if(PK_ENABLE_OS) + if(PK_ENABLE_OS AND PK_ENABLE_DLL) target_link_libraries(${PROJECT_NAME} dl) endif() elseif(WIN32) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index edd50f9d..573fcd7e 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -8,6 +8,7 @@ endif() # system features option(PK_ENABLE_OS "" ON) option(PK_ENABLE_THREADS "" ON) +option(PK_ENABLE_DLL "" ON) option(PK_ENABLE_DETERMINISM "" ON) option(PK_ENABLE_WATCHDOG "" OFF) option(PK_ENABLE_CUSTOM_SNAME "" OFF) diff --git a/include/pocketpy/config.h b/include/pocketpy/config.h index 4ea9795e..2e219c77 100644 --- a/include/pocketpy/config.h +++ b/include/pocketpy/config.h @@ -1,18 +1,22 @@ #pragma once // clang-format off -#define PK_VERSION "2.1.8" +#define PK_VERSION "2.1.9" #define PK_VERSION_MAJOR 2 #define PK_VERSION_MINOR 1 -#define PK_VERSION_PATCH 8 +#define PK_VERSION_PATCH 9 /*************** feature settings ***************/ #ifndef PK_ENABLE_OS // can be overridden by cmake #define PK_ENABLE_OS 1 #endif -#ifndef PK_ENABLE_THREADS // can be overridden by cmake -#define PK_ENABLE_THREADS 1 +#ifndef PK_ENABLE_THREADS // must be enabled from cmake +#define PK_ENABLE_THREADS 0 +#endif + +#ifndef PK_ENABLE_DLL // must be enabled from cmake +#define PK_ENABLE_DLL 0 #endif #ifndef PK_ENABLE_DETERMINISM // must be enabled from cmake diff --git a/src/interpreter/dll.c b/src/interpreter/dll.c index f45360e9..0f4bd6c1 100644 --- a/src/interpreter/dll.c +++ b/src/interpreter/dll.c @@ -1,6 +1,6 @@ #include "pocketpy/pocketpy.h" -#if PK_IS_DESKTOP_PLATFORM && PK_ENABLE_OS +#if PK_IS_DESKTOP_PLATFORM && PK_ENABLE_OS && PK_ENABLE_DLL #ifdef _WIN32