diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 241fb86a..2e6baeab 100644 --- a/.github/workflows/main.yml +++ b/.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: diff --git a/CMakeLists.txt b/CMakeLists.txt index 5de9cabf..b5df6cfb 100644 --- a/CMakeLists.txt +++ b/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") diff --git a/amalgamate.py b/amalgamate.py index 0464c506..e3da24b6 100644 --- a/amalgamate.py +++ b/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!")