Compare commits
18 Commits
prerelease
...
prerelease
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5277814af0 | ||
|
|
8928ab2d99 | ||
|
|
d08b307c6e | ||
|
|
6474329afc | ||
|
|
c49e67c839 | ||
|
|
25cb96e473 | ||
|
|
f11890a8b3 | ||
|
|
59b1d222c2 | ||
|
|
2fba132016 | ||
|
|
bddc2cdc79 | ||
|
|
e1b80b42d9 | ||
|
|
dab86925b4 | ||
|
|
0f45052dce | ||
|
|
68f4207216 | ||
|
|
f9f8ca08c6 | ||
|
|
0666b02c13 | ||
|
|
1654507835 | ||
|
|
d054ece8e2 |
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -117,12 +117,21 @@ jobs:
|
|||||||
base-devel
|
base-devel
|
||||||
mingw-w64-x86_64-gcc
|
mingw-w64-x86_64-gcc
|
||||||
mingw-w64-x86_64-make
|
mingw-w64-x86_64-make
|
||||||
mingw-w64-x86_64-gmp
|
mingw-w64-x86_64-cmake
|
||||||
mingw-w64-x86_64-gc
|
mingw-w64-x86_64-python
|
||||||
|
mingw-w64-x86_64-python-pip
|
||||||
|
mingw-w64-x86_64-flex
|
||||||
|
|
||||||
|
- name: Install Conan
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install conan
|
||||||
|
conan profile detect
|
||||||
|
|
||||||
- name: Build Project
|
- name: Build Project
|
||||||
run: |
|
run: |
|
||||||
make
|
conan install . --profile mingw-profile.txt --build=missing
|
||||||
|
conan build .
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
@@ -130,7 +139,7 @@ jobs:
|
|||||||
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
|
$ARCH = if ([Environment]::Is64BitOperatingSystem) { 'x64' } else { 'x86' }
|
||||||
$FOLDER = "chloride-$TAG-windows-$ARCH"
|
$FOLDER = "chloride-$TAG-windows-$ARCH"
|
||||||
$ZIP = "$FOLDER.zip"
|
$ZIP = "$FOLDER.zip"
|
||||||
Rename-Item bin $FOLDER
|
Rename-Item build/bin $FOLDER
|
||||||
Copy-Item LICENSE.txt $FOLDER
|
Copy-Item LICENSE.txt $FOLDER
|
||||||
Compress-Archive -Path $FOLDER -DestinationPath $ZIP
|
Compress-Archive -Path $FOLDER -DestinationPath $ZIP
|
||||||
echo "TAR_NAME=$ZIP" >> $env:GITHUB_ENV
|
echo "TAR_NAME=$ZIP" >> $env:GITHUB_ENV
|
||||||
@@ -150,6 +159,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
|
||||||
|
|||||||
@@ -52,9 +52,6 @@ find_package(BDWgc REQUIRED)
|
|||||||
find_package(gmp REQUIRED)
|
find_package(gmp REQUIRED)
|
||||||
|
|
||||||
target_compile_options(argon PRIVATE -O3 -Wall -Wextra -Wno-unused-function -s)
|
target_compile_options(argon PRIVATE -O3 -Wall -Wextra -Wno-unused-function -s)
|
||||||
if(NOT APPLE)
|
|
||||||
target_link_options(argon PRIVATE -static)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_link_libraries(argon PRIVATE
|
target_link_libraries(argon PRIVATE
|
||||||
BDWgc::BDWgc
|
BDWgc::BDWgc
|
||||||
|
|||||||
30
Makefile
30
Makefile
@@ -8,18 +8,15 @@ FLEX_TOOL = flex
|
|||||||
|
|
||||||
CFILES = external/xxhash/xxhash.c external/cwalk/src/cwalk.c external/libdye/src/dye.c $(shell find src -name '*.c')
|
CFILES = external/xxhash/xxhash.c external/cwalk/src/cwalk.c external/libdye/src/dye.c $(shell find src -name '*.c')
|
||||||
|
|
||||||
# If target is "windows", override FLEX_TOOL
|
|
||||||
ifeq ($(MAKECMDGOALS),windows)
|
|
||||||
BINARY = bin/argon.exe
|
|
||||||
FLEX_TOOL = win_flex
|
|
||||||
|
|
||||||
CFILES = external/xxhash/xxhash.c external/cwalk/src/cwalk.c external/libdye/src/dye.c $(shell dir /b /s src\*.c)
|
|
||||||
endif
|
|
||||||
|
|
||||||
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
|
||||||
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
|
||||||
|
LDFLAGS = -lgc -lgmp -lm
|
||||||
|
|
||||||
|
ifeq ($(MAKECMDGOALS),windows)
|
||||||
|
LDFLAGS = -Wl,-Bstatic -lgc -lgmp -Wl,-Bdynamic -lm
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(BINARY)
|
all: $(BINARY)
|
||||||
|
|
||||||
@@ -29,16 +26,19 @@ $(LEXER_C) $(LEXER_H): $(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)
|
windows: $(CFILES) $(LEXER_C) $(LEXER_H)
|
||||||
dir /b /s external\xxhash\xxhash.c external\cwalk\src\cwalk.c external\libdye\src\dye.c src\*.c > sources.txt
|
(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
|
mkdir -p bin
|
||||||
gcc -O3 -march=native -o $(BINARY) @sources.txt $(CFLAGS)
|
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
|
||||||
@@ -46,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:
|
||||||
|
|||||||
13
conanfile.py
13
conanfile.py
@@ -33,16 +33,11 @@ class ArgonConan(ConanFile):
|
|||||||
os.environ["CONAN_NON_INTERACTIVE"] = "1"
|
os.environ["CONAN_NON_INTERACTIVE"] = "1"
|
||||||
tc = CMakeToolchain(self)
|
tc = CMakeToolchain(self)
|
||||||
|
|
||||||
if os.name == "nt": # Windows
|
flex_path = which("flex")
|
||||||
flex_path = which("win_flex") or which("win_flex.exe")
|
if not flex_path:
|
||||||
if not flex_path:
|
raise Exception("Flex not found in system PATH. Please install flex on Linux/macOS.")
|
||||||
raise Exception("win_flex not found in PATH. Install winflexbison via choco.")
|
|
||||||
else:
|
|
||||||
flex_path = which("flex")
|
|
||||||
if not flex_path:
|
|
||||||
raise Exception("Flex not found in system PATH. Please install flex on Linux/macOS.")
|
|
||||||
|
|
||||||
tc.variables["FLEX_EXECUTABLE"] = flex_path.replace("\\", "\\\\")
|
tc.variables["FLEX_EXECUTABLE"] = flex_path
|
||||||
tc.generate()
|
tc.generate()
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
|
|||||||
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