Compare commits
11 Commits
prerelease
...
prerelease
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f45052dce | ||
|
|
68f4207216 | ||
|
|
f9f8ca08c6 | ||
|
|
0666b02c13 | ||
|
|
1654507835 | ||
|
|
d054ece8e2 | ||
|
|
4937942d6e | ||
|
|
82ea92183f | ||
|
|
5fb15b476f | ||
|
|
d1a455dbbe | ||
|
|
a81640747d |
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
@@ -100,39 +100,29 @@ jobs:
|
|||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-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 MSYS2 and build tools
|
- uses: msys2/setup-msys2@v2
|
||||||
uses: msys2/setup-msys2@v3
|
|
||||||
with:
|
with:
|
||||||
|
msystem: MINGW64
|
||||||
update: true
|
update: true
|
||||||
install: >
|
install: >
|
||||||
mingw-w64-x86_64-toolchain
|
base-devel
|
||||||
mingw-w64-x86_64-gmp
|
mingw-w64-x86_64-gcc
|
||||||
mingw-w64-x86_64-make
|
mingw-w64-x86_64-make
|
||||||
mingw-w64-x86_64-flex
|
mingw-w64-x86_64-gmp
|
||||||
mingw-w64-x86_64-bison
|
mingw-w64-x86_64-gc
|
||||||
shell: msys2 {0}
|
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Build Project
|
||||||
uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
|
|
||||||
- name: Install Conan
|
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
make windows
|
||||||
pip install conan
|
|
||||||
conan profile detect
|
|
||||||
shell: pwsh
|
|
||||||
|
|
||||||
- name: Build with MinGW
|
|
||||||
run: |
|
|
||||||
make
|
|
||||||
shell: msys2 {0}
|
|
||||||
|
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
20
Makefile
20
Makefile
@@ -2,23 +2,35 @@
|
|||||||
#
|
#
|
||||||
# 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)
|
||||||
|
(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)
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
[settings]
|
|
||||||
os=Windows
|
|
||||||
arch=x86_64
|
|
||||||
compiler=gcc
|
|
||||||
compiler.version=13
|
|
||||||
compiler.cppstd=gnu17
|
|
||||||
compiler.libcxx=libstdc++11
|
|
||||||
build_type=Release
|
|
||||||
@@ -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