Skip to content

Commit

Permalink
Merge pull request #7 from skolemlabs/fix/cflags-and-ci
Browse files Browse the repository at this point in the history
fix: remove empty c/library flags and add CI
  • Loading branch information
zbaylin authored Dec 28, 2021
2 parents b0e9f33 + 25c3fcb commit 16661d9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
- push

jobs:
build:
name: Build and test

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-version:
- 4.12.1

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@master

- name: Use OCaml ${{ matrix.ocaml-version }}
uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
opam-depext: false
opam-pin: false

- run: opam pin add mysql8.dev -n .
- run: opam depext -yt mysql8
- run: opam install -t . --deps-only
- run: opam exec -- dune build
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* Sat Dec 18 2021 (1.2.6)
* Filter empty C/library flags from `mysql_config`
* Add Github Actions-based CI

* Fri Dec 17 2021 (1.2.5)
* Add library path fixes for brew for openssl library linking

Expand Down
6 changes: 4 additions & 2 deletions src/config/discover.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ let mysql_config_path =
let c_flags =
match execute_with_output (mysql_config_path ^ " --cflags") with
| Some str ->
String.split_on_char ' ' str @ [ "-fPIC" ]
String.split_on_char ' ' str @ [ "-fPIC" ] |> List.filter (( <> ) "")
| None -> []

let libs =
match execute_with_output (mysql_config_path ^ " --libs") with
| Some str -> String.split_on_char ' ' str @ [ "-L/usr/local/opt/openssl/lib/" ]
| Some str ->
String.split_on_char ' ' str @ [ "-L/usr/local/opt/openssl/lib/" ]
|> List.filter (( <> ) "")
| None -> []

let replace_exact rep _with str =
Expand Down

0 comments on commit 16661d9

Please sign in to comment.