Skip to content

Commit df5f591

Browse files
authored
Merge pull request #200 from blade-lang/dev
Dev
2 parents 6757991 + 6e9a2d0 commit df5f591

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+12127
-1075
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: CI
22

33
on:
44
push:
5-
branches: [ dev, imagine ]
5+
branches-ignore:
6+
- main
67
pull_request:
78
branches: [ main ]
89

@@ -29,7 +30,7 @@ jobs:
2930
run: |
3031
sudo apt-get update
3132
sudo apt-get remove libgd3
32-
sudo apt-get install curl libcurl4-openssl-dev libgd-dev libavif-dev libffi-dev -y
33+
sudo apt-get install curl libpthread-stubs0-dev libcurl4-openssl-dev libgd-dev libavif-dev libffi-dev -y
3334
cmake -B .
3435
cmake --build . -- -j 12
3536
chmod +x blade/blade
@@ -99,7 +100,7 @@ jobs:
99100
run: |
100101
${{ env.VCPKG_ROOT }}/vcpkg update
101102
${{ env.VCPKG_ROOT }}/vcpkg version
102-
${{ env.VCPKG_ROOT }}/vcpkg install pkgconf curl:x64-windows libffi:x64-windows openssl:x64-windows libgd:x64-windows
103+
${{ env.VCPKG_ROOT }}/vcpkg install pkgconf pthreads:x64-windows curl:x64-windows libffi:x64-windows openssl:x64-windows libgd:x64-windows
103104
${{ env.VCPKG_ROOT }}/vcpkg list
104105
- name: Save vcpkg dependencies cache
105106
id: vcpkg-cache-save

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
sudo apt-get update
2020
sudo apt-get remove libgd3
21-
sudo apt-get install curl libcurl4-openssl-dev libgd-dev libavif-dev libffi-dev -y
21+
sudo apt-get install curl libpthread-stubs0-dev libcurl4-openssl-dev libgd-dev libavif-dev libffi-dev -y
2222
cmake -B .
2323
cmake --build . -- -j 12
2424
- name: Create ZIP Archive
@@ -94,7 +94,7 @@ jobs:
9494
run: |
9595
${{ env.VCPKG_ROOT }}/vcpkg update
9696
${{ env.VCPKG_ROOT }}/vcpkg version
97-
${{ env.VCPKG_ROOT }}/vcpkg install pkgconf curl:x64-windows libffi:x64-windows openssl:x64-windows libgd:x64-windows
97+
${{ env.VCPKG_ROOT }}/vcpkg install pkgconf pthreads:x64-windows curl:x64-windows libffi:x64-windows openssl:x64-windows libgd:x64-windows
9898
${{ env.VCPKG_ROOT }}/vcpkg list
9999
- name: Compile
100100
run: |

CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ set(BLADE_SOURCES
6969
src/standard/process.c
7070
src/standard/reflect.c
7171
src/standard/struct.c
72-
)
72+
src/standard/thread.c)
7373

7474
add_definitions(-DEXPORT_LIBS)
7575

@@ -131,7 +131,7 @@ check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY)
131131
if(NOT "${HAVE_GETTIMEOFDAY}")
132132
target_link_libraries(libblade PRIVATE gettimeofday)
133133
endif()
134-
target_link_libraries(libblade PRIVATE threads)
134+
check_function_exists("timespec_get" HAVE_TIMESPEC_GET)
135135

136136
check_function_exists("utime" HAVE_UTIME)
137137
check_function_exists("basename" HAVE_BASENAME)
@@ -189,14 +189,23 @@ if(UNIX)
189189

190190
target_link_libraries(libblade PRIVATE m)
191191
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
192-
target_link_libraries(libblade PRIVATE pthread)
193192
target_link_libraries(libblade PRIVATE dl)
194193
endif()
194+
195+
set(THREADS_PREFER_PTHREAD_FLAG ON)
196+
find_package(Threads REQUIRED)
197+
target_link_libraries(libblade PRIVATE Threads::Threads)
198+
# target_link_libraries(libblade PRIVATE pthread)
195199
endif(UNIX)
196200

197201
if(WIN32)
198202
add_dependencies(libblade mman)
199203
target_link_libraries(libblade PRIVATE mman)
204+
205+
find_package(PThreads4W REQUIRED)
206+
target_link_libraries(libblade PRIVATE PThreads4W::PThreads4W)
207+
208+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pragmas")
200209
endif()
201210

202211
target_link_libraries(blade PRIVATE libblade)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![Build Status](https://github.com/blade-lang/blade/actions/workflows/ci.yml/badge.svg)](https://github.com/blade-lang/blade/actions)
88
[![Gitter](https://badges.gitter.im/blade-lang/community.svg)](https://gitter.im/blade-lang/community)
9-
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/blade-lang/blade/blob/master/LICENSE)
9+
[![License](https://img.shields.io/badge/License-BSDL-blue.svg)](https://github.com/blade-lang/blade/blob/master/LICENSE)
1010
[![Coverage Status](https://coveralls.io/repos/github/blade-lang/blade/badge.svg?branch=main)](https://coveralls.io/github/blade-lang/blade?branch=main)
1111
[![Version](https://img.shields.io/badge/version-0.0.86-green)](https://github.com/blade-lang/blade)
1212

0 commit comments

Comments
 (0)