Compare commits
26 Commits
prerelease
...
prerelease
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d08b307c6e | ||
|
|
6474329afc | ||
|
|
c49e67c839 | ||
|
|
25cb96e473 | ||
|
|
f11890a8b3 | ||
|
|
59b1d222c2 | ||
|
|
2fba132016 | ||
|
|
bddc2cdc79 | ||
|
|
e1b80b42d9 | ||
|
|
dab86925b4 | ||
|
|
0f45052dce | ||
|
|
68f4207216 | ||
|
|
f9f8ca08c6 | ||
|
|
0666b02c13 | ||
|
|
1654507835 | ||
|
|
d054ece8e2 | ||
|
|
4937942d6e | ||
|
|
82ea92183f | ||
|
|
5fb15b476f | ||
|
|
d1a455dbbe | ||
|
|
a81640747d | ||
|
|
4a1ed23f96 | ||
|
|
eb36d02fcb | ||
|
|
7b3a1e1835 | ||
|
|
8e53579682 | ||
|
|
0d8f262185 |
50
.github/workflows/release.yml
vendored
50
.github/workflows/release.yml
vendored
@@ -99,19 +99,26 @@ 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-python
|
||||||
|
mingw-w64-x86_64-python-pip
|
||||||
|
|
||||||
- name: Install Conan
|
- name: Install Conan
|
||||||
run: |
|
run: |
|
||||||
@@ -119,26 +126,22 @@ jobs:
|
|||||||
pip install conan
|
pip install conan
|
||||||
conan profile detect
|
conan profile detect
|
||||||
|
|
||||||
- name: Build Windows with MinGW
|
- name: Build Project
|
||||||
run: |
|
run: |
|
||||||
conan install . \
|
conan install . --profile mingw-profile.txt --build=missing
|
||||||
-s os=Windows \
|
|
||||||
-s compiler=gcc \
|
|
||||||
-s compiler.version=13 \
|
|
||||||
-s compiler.libcxx=libstdc++11 \
|
|
||||||
-s arch=x86_64 \
|
|
||||||
--build=missing
|
|
||||||
conan build .
|
conan build .
|
||||||
|
|
||||||
- name: Package Windows build
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
TAG=${GITHUB_REF##refs/tags/}
|
$TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
|
||||||
FOLDER="chloride-$TAG-windows-x64"
|
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
|
||||||
ZIP="$FOLDER.zip"
|
$FOLDER = "chloride-$TAG-windows-$ARCH"
|
||||||
mv build/bin "$FOLDER"
|
$ZIP = "$FOLDER.zip"
|
||||||
cp LICENSE.txt "$FOLDER"
|
Rename-Item bin $FOLDER
|
||||||
zip -r "$ZIP" "$FOLDER"
|
Copy-Item LICENSE.txt $FOLDER
|
||||||
echo "TAR_NAME=$ZIP" >> $GITHUB_ENV
|
Compress-Archive -Path $FOLDER -DestinationPath $ZIP
|
||||||
|
echo "TAR_NAME=$ZIP" >> $env:GITHUB_ENV
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -154,6 +157,7 @@ jobs:
|
|||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ./artifacts
|
path: ./artifacts
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
|
|||||||
@@ -51,20 +51,7 @@ set_target_properties(argon PROPERTIES
|
|||||||
find_package(BDWgc REQUIRED)
|
find_package(BDWgc REQUIRED)
|
||||||
find_package(gmp REQUIRED)
|
find_package(gmp REQUIRED)
|
||||||
|
|
||||||
target_compile_options(argon PRIVATE -O3 -Wall -s)
|
target_compile_options(argon PRIVATE -O3 -Wall -Wextra -Wno-unused-function -s)
|
||||||
if(MSVC)
|
|
||||||
# Disable warning C4061 (enum in switch not handled)
|
|
||||||
target_compile_options(argon PRIVATE /wd4061)
|
|
||||||
|
|
||||||
# Disable Spectre mitigation warning C5045
|
|
||||||
target_compile_options(argon PRIVATE /wd5045)
|
|
||||||
|
|
||||||
# Optionally, remove "treat warnings as errors" if enabled
|
|
||||||
# target_compile_options(argon PRIVATE /WX-) # uncomment if you previously used /WX
|
|
||||||
endif()
|
|
||||||
if(NOT APPLE)
|
|
||||||
target_link_options(argon PRIVATE -static)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(argon PRIVATE
|
target_link_libraries(argon PRIVATE
|
||||||
BDWgc::BDWgc
|
BDWgc::BDWgc
|
||||||
|
|||||||
35
Makefile
35
Makefile
@@ -2,26 +2,43 @@
|
|||||||
#
|
#
|
||||||
# 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
|
LDFLAGS = -lgc -lgmp -lm
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),windows)
|
||||||
|
LDFLAGS = -Wl,-Bstatic -lgc -lgmp -Wl,-Bdynamic -lm
|
||||||
|
endif
|
||||||
|
|
||||||
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) ${LDFLAGS} -s
|
||||||
|
|
||||||
|
windows: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
|
(echo -n "external/xxhash/xxhash.c " ; \
|
||||||
|
echo -n "external/cwalk/src/cwalk.c " ; \
|
||||||
|
echo -n "external/libdye/src/dye.c " ; \
|
||||||
|
find src -name '*.c' -print0 | xargs -0 echo -n) > sources.txt
|
||||||
|
mkdir -p bin
|
||||||
|
gcc -O3 -march=native -o $(BINARY) @sources.txt $(CFLAGS) -lbcrypt
|
||||||
|
|
||||||
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) ${LDFLAGS}
|
||||||
|
|
||||||
debug: $(CFILES) $(LEXER_C) $(LEXER_H)
|
debug: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
@@ -29,13 +46,13 @@ debug: $(CFILES) $(LEXER_C) $(LEXER_H)
|
|||||||
|
|
||||||
full-debug: $(CFILES) $(LEXER_C) $(LEXER_H)
|
full-debug: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
gcc -g -O0 -fsanitize=address -fno-omit-frame-pointer -o $(BINARY) $(CFILES) $(CFLAGS)
|
gcc -g -O0 -fsanitize=address -fno-omit-frame-pointer -o $(BINARY) $(CFILES) $(CFLAGS) ${LDFLAGS}
|
||||||
|
|
||||||
optimised: $(CFILES) $(LEXER_C) $(LEXER_H)
|
optimised: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
gcc -O3 -fprofile-generate -o $(BINARY) $(CFILES) $(CFLAGS)
|
gcc -O3 -fprofile-generate -o $(BINARY) $(CFILES) $(CFLAGS) ${LDFLAGS}
|
||||||
${BINARY} rand_test.ar
|
${BINARY} rand_test.ar
|
||||||
gcc -O3 -fprofile-use -o $(BINARY) $(CFILES) $(CFLAGS)
|
gcc -O3 -fprofile-use -o $(BINARY) $(CFILES) $(CFLAGS) ${LDFLAGS}
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
12
mingw-profile.txt
Normal file
12
mingw-profile.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
[settings]
|
||||||
|
os=Windows
|
||||||
|
compiler=gcc
|
||||||
|
compiler.version=12
|
||||||
|
compiler.libcxx=libstdc++11
|
||||||
|
compiler.threads=posix
|
||||||
|
compiler.exception=seh
|
||||||
|
arch=x86_64
|
||||||
|
build_type=Release
|
||||||
|
|
||||||
|
[tool_requires]
|
||||||
|
mingw-builds/12.2.0
|
||||||
@@ -16,8 +16,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <psapi.h>
|
#ifndef _WIN32_WINNT
|
||||||
|
#define _WIN32_WINNT 0x0602
|
||||||
|
#endif
|
||||||
#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