Browse Source

change default settings

blueloveTH 8 months ago
parent
commit
7ea00a3954
3 changed files with 9 additions and 3 deletions
  1. 2 2
      CMakeOptions.txt
  2. 1 1
      cmake_build.py
  3. 6 0
      include/pocketpy/config.h

+ 2 - 2
CMakeOptions.txt

@@ -6,8 +6,8 @@ else()
 endif()
 endif()
 
 
 # system features
 # 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_DETERMINISM "" OFF)
 option(PK_ENABLE_WATCHDOG "" OFF)
 option(PK_ENABLE_WATCHDOG "" OFF)
 option(PK_ENABLE_CUSTOM_SNAME "" OFF)
 option(PK_ENABLE_CUSTOM_SNAME "" OFF)

+ 1 - 1
cmake_build.py

@@ -20,7 +20,7 @@ assert config in ['Debug', 'Release', 'RelWithDebInfo']
 
 
 os.chdir("build")
 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
 assert code == 0
 code = os.system(f"cmake --build . --config {config} -j 4")
 code = os.system(f"cmake --build . --config {config} -j 4")
 assert code == 0
 assert code == 0

+ 6 - 0
include/pocketpy/config.h

@@ -84,3 +84,9 @@
         #define restrict
         #define restrict
     #endif
     #endif
 #endif
 #endif
+
+#if PK_ENABLE_THREADS
+    #define PK_THREAD_LOCAL _Thread_local
+#else
+    #define PK_THREAD_LOCAL
+#endif