Compare commits

...

9 Commits

Author SHA1 Message Date
William Bell
f420273471 fix backslashes 2025-08-16 02:46:33 +01:00
William Bell
4b2a747338 use msys/flex 2025-08-16 02:36:47 +01:00
William Bell
5277814af0 fix conan 2025-08-16 02:31:15 +01:00
William Bell
8928ab2d99 add cmake as dependency 2025-08-16 02:20:57 +01:00
William Bell
d08b307c6e add python as a dependency 2025-08-16 02:12:55 +01:00
William Bell
6474329afc switch to conan for windows 2025-08-16 02:08:56 +01:00
William Bell
c49e67c839 switch windows to use conan 2025-08-16 02:04:00 +01:00
William Bell
25cb96e473 try get it to be static 2025-08-16 01:57:56 +01:00
William Bell
f11890a8b3 fix linking for linux and macos 2025-08-16 01:39:44 +01:00
5 changed files with 35 additions and 19 deletions

View File

@@ -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
msys/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 windows 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

View File

@@ -54,17 +54,13 @@ 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)
target_link_libraries(argon PRIVATE target_link_libraries(argon PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libgc.a" BDWgc::BDWgc
"${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libgmp.a" gmp::gmp
m m
) )
target_include_directories(argon PRIVATE target_include_directories(argon PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/lexer ${CMAKE_CURRENT_SOURCE_DIR}/src/lexer
${BDWgc_INCLUDE_DIRS} # BDWgc headers
${GMP_INCLUDE_DIR} # GMP headers
${CMAKE_CURRENT_SOURCE_DIR}/external/cwalk/include
${CMAKE_CURRENT_SOURCE_DIR}/external/libdye/include
) )
add_custom_command(TARGET argon POST_BUILD COMMAND ${CMAKE_STRIP} $<TARGET_FILE:argon>) add_custom_command(TARGET argon POST_BUILD COMMAND ${CMAKE_STRIP} $<TARGET_FILE:argon>)

View File

@@ -12,7 +12,11 @@ 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 LDFLAGS = -Wl,-Bstatic -lgc -lgmp -Wl,-Bdynamic -lm
endif
all: $(BINARY) all: $(BINARY)

View File

@@ -33,11 +33,6 @@ 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("win_flex") or which("win_flex.exe")
if not flex_path:
raise Exception("win_flex not found in PATH. Install winflexbison via choco.")
else:
flex_path = which("flex") flex_path = which("flex")
if not flex_path: if not flex_path:
raise Exception("Flex not found in system PATH. Please install flex on Linux/macOS.") raise Exception("Flex not found in system PATH. Please install flex on Linux/macOS.")

12
mingw-profile.txt Normal file
View 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