Răsfoiți Sursa

fix compile flags

blueloveTH 10 luni în urmă
părinte
comite
6f79fb0bf3
3 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 1 1
      .github/workflows/main.yml
  2. 1 0
      CMakeLists.txt
  3. 1 1
      amalgamate.py

+ 1 - 1
.github/workflows/main.yml

@@ -24,7 +24,7 @@ jobs:
       run: |
         python amalgamate.py
         cd amalgamated
-        cl.exe /std:c11 /utf-8 /Ox /I. pocketpy.c main.c /link /out:pkpy.exe
+        cl.exe /std:c11 /experimental:c11atomics /utf-8 /Ox /I. pocketpy.c main.c /link /out:pkpy.exe
   build_win32:
     runs-on: windows-latest
     steps:

+ 1 - 0
CMakeLists.txt

@@ -18,6 +18,7 @@ endif()
 
 if(MSVC)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /jumptablerdata /GS-")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /experimental:c11atomics")
     add_compile_options(/wd4267 /wd4244)
 
     if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")

+ 1 - 1
amalgamate.py

@@ -149,7 +149,7 @@ write_file('amalgamated/pocketpy.h', merge_h_files())
 shutil.copy("src2/main.c", "amalgamated/main.c")
 
 if sys.platform in ['linux', 'darwin']:
-	ok = os.system("gcc -o main amalgamated/pocketpy.c amalgamated/main.c -O1 --std=c11 -lm -ldl")
+	ok = os.system("gcc -o main amalgamated/pocketpy.c amalgamated/main.c -O1 --std=c11 -lm -ldl -lpthread")
 	if ok == 0:
 		print("Test build success!")