Skip to content

Commit 3f54676

Browse files
author
Aidan Lee
committed
Merge branch 'master' into simdutf-strings
2 parents 9b29d63 + 56ab586 commit 3f54676

224 files changed

Lines changed: 55000 additions & 21599 deletions

File tree

Some content is hidden

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

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@ name: main
22
on: [push, pull_request]
33

44
jobs:
5+
check-headers:
6+
name: Check headers
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: checkout
10+
uses: actions/checkout@v4
11+
12+
- name: Install pcre2grep
13+
run: sudo apt-get update && sudo apt-get install -y pcre2-utils
14+
15+
- run: |
16+
# macros in public headers must use the global namespace to qualify types
17+
! pcre2grep --buffer-size=1M --recursive --multiline --line-number --include='.*\.h$' \
18+
'#define\s+(?:.*\\\r?\n)*.*?\K(?<!:)\b(Enum|String|StringOffset|Array|ArrayClassID|Math|Math_obj|Void|null|Dynamic|hx::|cpp::)\b' \
19+
include
20+
name: Check public headers
21+
522
Windows32:
623
strategy:
724
fail-fast: false

.github/workflows/package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ jobs:
135135
uses: ncipollo/release-action@v1
136136
with:
137137
tag: v${{ env.hxcpp_release }}
138-
commit: ${{ github.head_ref }}
138+
commit: ${{ github.ref }}
139139
name: Release ${{ env.hxcpp_release }}
140140
draft: false
141141
prerelease: false
142-
artifacts: ./hxcpp-${{ env.hxcpp_release }}.zip
142+
artifacts: ./hxcpp-${{ env.hxcpp_release }}.zip

.github/workflows/test.yml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,30 @@ jobs:
196196
steps:
197197
- name: checkout
198198
uses: actions/checkout@v4
199+
- name: setup
200+
uses: ./.github/workflows/setup
201+
with:
202+
haxe: ${{ inputs.haxe }}
203+
- name: Get Haxe commit SHA
204+
if: inputs.haxe == 'latest'
205+
id: haxe_sha
206+
shell: bash
207+
working-directory:
208+
${{github.workspace}}
209+
env:
210+
GH_TOKEN: ${{ github.token }}
211+
run: |
212+
version=$(haxe --version)
213+
short_sha=${version##*+}
214+
full_sha=$(gh api repos/HaxeFoundation/haxe/commits/$short_sha --jq '.sha')
215+
echo "Haxe version: $version"
216+
echo "sha=$full_sha" >> "$GITHUB_OUTPUT"
217+
echo "Commit SHA: $short_sha, Full SHA: $full_sha"
199218
- name: checkout haxe (latest)
200219
if: inputs.haxe == 'latest'
201220
uses: actions/checkout@v4
202221
with:
222+
ref: ${{ steps.haxe_sha.outputs.sha }}
203223
repository: HaxeFoundation/haxe
204224
path: haxe
205225
- name: checkout haxe (stable)
@@ -209,10 +229,6 @@ jobs:
209229
repository: HaxeFoundation/haxe
210230
path: haxe
211231
ref: ${{ inputs.haxe }}
212-
- name: setup
213-
uses: ./.github/workflows/setup
214-
with:
215-
haxe: ${{ inputs.haxe }}
216232
- name: install haxe libs
217233
run: haxelib install compile-cpp.hxml --always
218234
# haxe 4 tests don't build with latest utest
@@ -221,3 +237,21 @@ jobs:
221237
run: haxe compile-cpp.hxml -D ${{ env.HXCPP_ARCH_FLAG }} -D no_http
222238
- name: run
223239
run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug
240+
build_tool:
241+
runs-on: ${{ inputs.os }}
242+
name: build tool tests
243+
steps:
244+
- name: checkout
245+
uses: actions/checkout@v4
246+
- name: setup
247+
uses: ./.github/workflows/setup
248+
with:
249+
haxe: ${{ inputs.haxe }}
250+
- name: test c/cxx_standard attributes
251+
working-directory: test/cxx_standard
252+
shell: bash
253+
run: |
254+
for xml in *.xml; do
255+
haxelib run hxcpp $xml
256+
haxelib run hxcpp $xml clean
257+
done

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ hxcpp.n
2929

3030
.vscode
3131

32+
test/cxx_standard/main
33+
test/cxx_standard/main.hash
34+
test/cxx_standard/main.exe
35+
test/cxx_standard/main.exe.hash
36+
3237
# Created by https://www.toptal.com/developers/gitignore/api/visualstudio
3338
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio
3439

docs/build_xml/Defines.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ Defines affecting how the code is compiled. These can be on the command line wh
3737
| *HXCPP_CHECK_POINTER* | Add null-pointer checks,even in release mode. |
3838
| *HXCPP_PROFILER* | Add profiler support |
3939
| *HXCPP_TELEMETRY* | Add telemetry support |
40-
| *HXCPP_CPP11* | Use c++11 features and link libraries |
41-
| *HXCPP_CPP17* | Use c++17 features and link libraries |
40+
| *HXCPP_C_STANDARD* | Set default C standard |
41+
| *HXCPP_CXX_STANDARD* | Set default C++ standard |
42+
| *HXCPP_OBJC_STANDARD* | Set default Objective-C standard |
43+
| *HXCPP_OBJCXX_STANDARD* | Set default Objective-C++ standard |
4244
| *exe_link* | Generate executable file (rather than dynamic library on android) |
4345
| *static_link* | Generate static library |
4446
| *dll_link* | Generate dynamic library |

docs/build_xml/Files.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@ Files
22
------
33
The files node defines a group of files that all share the same attributes, including relative directory, default compiler flags and dependencies. The node can be used to define a set of header files on which other files can depend, or a set of source files to be compiled and included in a target.
44

5+
```xml
6+
<files id="foo" cxx_standard="14">
7+
<file name="foo.cpp"/>
8+
<file name="bar.c"/>
9+
</files>
10+
```
11+
12+
#### Attributes
13+
14+
+ `c_standard` = Default C standard for the file group
15+
+ `cxx_standard` = Default C++ standard for the file group
16+
+ `objc_standard` = Default Objective-C standard for the file group
17+
+ `objcxx_standard` = Default Objective-C++ standard for the file group
18+
#### Nodes
519
- *depend* - Declare that all files in the group depend on another file or another file group.
620
```xml
721
<depend name="filename" />
@@ -80,13 +94,17 @@ The files node defines a group of files that all share the same attributes, incl
8094

8195
- *file* - Add file to group, with optional attributes
8296
```xml
83-
<file name="filename" tags="tag,tag1" filterout="define" embedName="embed" >
97+
<file name="filename" tags="tag,tag1" filterout="define" embedName="embed" cxx_standard="17">
8498
<depend name="filename1" />
8599
<depend name="filename2" />
86100
</file>
87101
```
88102
+ name = name of file - may be absolute or relative to files.dir
89103
+ tags = optional override of group tags. See [Tags.md](Tags.md).
104+
+ `c_standard` = C standard for the file
105+
+ `cxx_standard` = C++ standard for the file
106+
+ `objc_standard` = Objective-C standard for the file
107+
+ `objcxx_standard` = Objective-C++ standard for the file
90108
+ filterout = allows files to be skipped at compile-time if the named define exists.
91109
This is useful when the define is set sometime after the file list is parsed.
92110
+ depend name = filename of additional dependency

0 commit comments

Comments
 (0)