fix compile flags

This commit is contained in:
blueloveTH 2025-04-13 18:35:48 +08:00
parent 9448214317
commit 6f79fb0bf3
3 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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")

View File

@ -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!")