From 7ea00a3954fb9cf878c35dba318c189679e1d758 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 30 Jun 2025 22:32:58 +0800 Subject: [PATCH] change default settings --- CMakeOptions.txt | 4 ++-- cmake_build.py | 2 +- include/pocketpy/config.h | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeOptions.txt b/CMakeOptions.txt index e9e241e2..b5417efd 100644 --- a/CMakeOptions.txt +++ b/CMakeOptions.txt @@ -6,8 +6,8 @@ else() endif() # system features -option(PK_ENABLE_OS "" OFF) -option(PK_ENABLE_THREADS "" OFF) +option(PK_ENABLE_OS "" ON) +option(PK_ENABLE_THREADS "" ON) option(PK_ENABLE_DETERMINISM "" OFF) option(PK_ENABLE_WATCHDOG "" OFF) option(PK_ENABLE_CUSTOM_SNAME "" OFF) diff --git a/cmake_build.py b/cmake_build.py index f1e1a3bd..8be0b2f2 100644 --- a/cmake_build.py +++ b/cmake_build.py @@ -20,7 +20,7 @@ assert config in ['Debug', 'Release', 'RelWithDebInfo'] os.chdir("build") -code = os.system(f"cmake .. -DPK_ENABLE_OS=ON -DPK_ENABLE_THREADS=ON -DPK_ENABLE_DETERMINISM=ON -DCMAKE_BUILD_TYPE={config} {extra_flags}") +code = os.system(f"cmake .. -DPK_ENABLE_DETERMINISM=ON -DCMAKE_BUILD_TYPE={config} {extra_flags}") assert code == 0 code = os.system(f"cmake --build . --config {config} -j 4") assert code == 0 diff --git a/include/pocketpy/config.h b/include/pocketpy/config.h index b9c9278c..7d48b24a 100644 --- a/include/pocketpy/config.h +++ b/include/pocketpy/config.h @@ -84,3 +84,9 @@ #define restrict #endif #endif + +#if PK_ENABLE_THREADS + #define PK_THREAD_LOCAL _Thread_local +#else + #define PK_THREAD_LOCAL +#endif