Compare commits

...

4 Commits

Author SHA1 Message Date
William Bell
6f84a4a485 fix conan file 2025-08-15 19:37:38 +01:00
William Bell
4b4b1fa777 fix release.yml 2025-08-15 19:22:26 +01:00
William Bell
2b6e785638 fix conan file 2025-08-15 19:19:15 +01:00
William Bell
51e82e5b2e fix release.yml 2025-08-15 19:15:28 +01:00
2 changed files with 26 additions and 13 deletions

View File

@@ -13,6 +13,21 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
# Linux
- name: Install build tools (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y flex bison
# macOS
- name: Install build tools (macOS)
if: runner.os == 'macOS'
run: brew install flex bison
# Windows
- name: Install build tools (Windows)
if: runner.os == 'Windows'
run: choco install winflexbison -y
shell: pwsh
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@@ -63,7 +78,7 @@ jobs:
- name: Determine if prerelease (Linux/macOS) - name: Determine if prerelease (Linux/macOS)
if: runner.os != 'Windows' if: runner.os != 'Windows'
id: prerelease_check id: prerelease_check_unix
run: | run: |
TAG=${GITHUB_REF##refs/tags/} TAG=${GITHUB_REF##refs/tags/}
if [[ "$TAG" == prerelease-* ]]; then if [[ "$TAG" == prerelease-* ]]; then
@@ -76,7 +91,7 @@ jobs:
- name: Determine if prerelease (Windows) - name: Determine if prerelease (Windows)
if: runner.os == 'Windows' if: runner.os == 'Windows'
id: prerelease_check id: prerelease_check_win
run: | run: |
$TAG = $env:GITHUB_REF -replace 'refs/tags/', '' $TAG = $env:GITHUB_REF -replace 'refs/tags/', ''
if ($TAG -like 'prerelease-*') { if ($TAG -like 'prerelease-*') {
@@ -121,5 +136,5 @@ jobs:
name: Release ${{ github.ref_name }} name: Release ${{ github.ref_name }}
body: Automated release based on tag ${{ github.ref_name }} body: Automated release based on tag ${{ github.ref_name }}
draft: false draft: false
prerelease: ${{ steps.prerelease_check.outputs.prerelease }} prerelease: ${{ runner.os == 'Windows' && steps.prerelease_check_win.outputs.prerelease || steps.prerelease_check_unix.outputs.prerelease }}
artifacts: ${{ env.TAR_NAME }} artifacts: ${{ env.TAR_NAME }}

View File

@@ -31,18 +31,16 @@ class ArgonConan(ConanFile):
def generate(self): def generate(self):
tc = CMakeToolchain(self) tc = CMakeToolchain(self)
# Try to find flex in system PATH first if os.name == "nt": # Windows
flex_path = which("flex") flex_path = which("win_flex") or which("win_flex.exe")
# If not found, fallback to flex from Conan build requirements
if not flex_path: if not flex_path:
flex_dep = self.dependencies.build.get("flex", None) raise Exception("win_flex not found in PATH. Install winflexbison via choco.")
if not flex_dep: else:
raise Exception("Flex not found in system PATH and not declared as build requirement") flex_path = which("flex")
flex_path = join(flex_dep.package_folder, "bin", "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 tc.variables["FLEX_EXECUTABLE"] = flex_path
tc.generate() tc.generate()
def build(self): def build(self):