Compare commits
12 Commits
prerelease
...
prerelease
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9f8ca08c6 | ||
|
|
0666b02c13 | ||
|
|
1654507835 | ||
|
|
d054ece8e2 | ||
|
|
4937942d6e | ||
|
|
82ea92183f | ||
|
|
5fb15b476f | ||
|
|
d1a455dbbe | ||
|
|
a81640747d | ||
|
|
4a1ed23f96 | ||
|
|
eb36d02fcb | ||
|
|
7b3a1e1835 |
55
.github/workflows/release.yml
vendored
55
.github/workflows/release.yml
vendored
@@ -99,45 +99,42 @@ jobs:
|
|||||||
path: ${{ env.TAR_NAME }}
|
path: ${{ env.TAR_NAME }}
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: ubuntu-latest
|
runs-on: windows-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: msys2 {0}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install MinGW-w64 for cross-compilation
|
- uses: msys2/setup-msys2@v2
|
||||||
run: sudo apt-get update && sudo apt-get install -y mingw-w64
|
|
||||||
|
|
||||||
- name: Setup Python
|
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
msystem: MINGW64
|
||||||
|
update: true
|
||||||
|
install: >
|
||||||
|
base-devel
|
||||||
|
mingw-w64-x86_64-gcc
|
||||||
|
mingw-w64-x86_64-make
|
||||||
|
mingw-w64-x86_64-gmp
|
||||||
|
mingw-w64-x86_64-gc
|
||||||
|
|
||||||
- name: Install Conan
|
- name: Build Project
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
make windows
|
||||||
pip install conan
|
|
||||||
conan profile detect
|
|
||||||
conan profile update settings.compiler.version=13 default
|
|
||||||
conan profile update settings.compiler=gcc default
|
|
||||||
conan profile update settings.os=Windows default
|
|
||||||
conan profile update env.CC=x86_64-w64-mingw32-gcc default
|
|
||||||
conan profile update env.CXX=x86_64-w64-mingw32-g++ default
|
|
||||||
|
|
||||||
- name: Build Windows with MinGW
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
conan install . --profile:host=mingw-windows --profile:build=default --build=missing
|
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
|
||||||
conan build .
|
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
|
||||||
|
$FOLDER = "chloride-$TAG-windows-$ARCH"
|
||||||
- name: Package Windows build
|
$ZIP = "$FOLDER.zip"
|
||||||
run: |
|
Rename-Item bin $FOLDER
|
||||||
TAG=${GITHUB_REF##refs/tags/}
|
Copy-Item LICENSE.txt $FOLDER
|
||||||
FOLDER="chloride-$TAG-windows-x64"
|
Compress-Archive -Path $FOLDER -DestinationPath $ZIP
|
||||||
ZIP="$FOLDER.zip"
|
echo "TAR_NAME=$ZIP" >> $env:GITHUB_ENV
|
||||||
mv build/bin "$FOLDER"
|
shell: pwsh
|
||||||
cp LICENSE.txt "$FOLDER"
|
|
||||||
zip -r "$ZIP" "$FOLDER"
|
|
||||||
echo "TAR_NAME=$ZIP" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
17
Makefile
17
Makefile
@@ -2,23 +2,32 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
# Default FLEX tool
|
||||||
|
BINARY = bin/argon
|
||||||
|
FLEX_TOOL = flex
|
||||||
|
|
||||||
|
CFILES = external/xxhash/xxhash.c external/cwalk/src/cwalk.c external/libdye/src/dye.c $(shell find src -name '*.c')
|
||||||
|
|
||||||
LEXER_SRC = src/lexer/lex.l
|
LEXER_SRC = src/lexer/lex.l
|
||||||
LEXER_C = src/lexer/lex.yy.c
|
LEXER_C = src/lexer/lex.yy.c
|
||||||
LEXER_H = src/lexer/lex.yy.h
|
LEXER_H = src/lexer/lex.yy.h
|
||||||
|
|
||||||
CFILES = external/xxhash/xxhash.c external/cwalk/src/cwalk.c external/libdye/src/dye.c $(shell find src -name '*.c')
|
|
||||||
CFLAGS = $(ARCHFLAGS) -lm -lgc -lgmp -Wall -Wextra -Wno-unused-function -Werror=unused-result -Iexternal/cwalk/include -Iexternal/libdye/include
|
CFLAGS = $(ARCHFLAGS) -lm -lgc -lgmp -Wall -Wextra -Wno-unused-function -Werror=unused-result -Iexternal/cwalk/include -Iexternal/libdye/include
|
||||||
BINARY = bin/argon
|
|
||||||
|
|
||||||
all: $(BINARY)
|
all: $(BINARY)
|
||||||
|
|
||||||
|
|
||||||
$(LEXER_C) $(LEXER_H): $(LEXER_SRC)
|
$(LEXER_C) $(LEXER_H): $(LEXER_SRC)
|
||||||
flex --header-file=$(LEXER_H) -o $(LEXER_C) $(LEXER_SRC)
|
$(FLEX_TOOL) --header-file=$(LEXER_H) -o $(LEXER_C) $(LEXER_SRC)
|
||||||
|
|
||||||
$(BINARY): $(CFILES) $(LEXER_C) $(LEXER_H)
|
$(BINARY): $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
gcc -O3 -o $(BINARY) $(CFILES) $(CFLAGS) -s
|
gcc -O3 -o $(BINARY) $(CFILES) $(CFLAGS) -s
|
||||||
|
|
||||||
|
windows: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
|
find external/xxhash external/cwalk external/libdye src -name '*.c' > sources.txt
|
||||||
|
mkdir -p bin
|
||||||
|
gcc -O3 -march=native -o $(BINARY) @sources.txt $(CFLAGS)
|
||||||
|
|
||||||
native: $(CFILES) $(LEXER_C) $(LEXER_H)
|
native: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
gcc -O3 -march=native -o $(BINARY) $(CFILES) $(CFLAGS)
|
gcc -O3 -march=native -o $(BINARY) $(CFILES) $(CFLAGS)
|
||||||
|
|||||||
@@ -16,8 +16,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <psapi.h>
|
#define _WIN32_WINNT 0x0602
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <psapi.h>
|
||||||
|
|
||||||
double get_memory_usage_mb() {
|
double get_memory_usage_mb() {
|
||||||
PROCESS_MEMORY_COUNTERS pmc;
|
PROCESS_MEMORY_COUNTERS pmc;
|
||||||
|
|||||||
Reference in New Issue
Block a user