Skip to content

Commit

Permalink
Use system library if present
Browse files Browse the repository at this point in the history
  • Loading branch information
clpo13 committed Jul 23, 2019
1 parent 430ff97 commit 1fc1f9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Simple SQLite app built with Meson, adapted from the public domain example found
- Meson
- Ninja

If the SQLite3 library is present on the system, the app will use that. Otherwise,
an older version will be downloaded from Meson's WrapDB.

## Building

```bash
Expand All @@ -17,6 +20,14 @@ ninja -C builddir
ninja -C builddir test
```

## Usage

`sqlite-test DATABASE SQL-STATEMENT`

Example:

`sqlite-test test.db "create table tbl1(one varchar(10), two smallint)"`

## License

Public domain per [The Unlicense](LICENSE).
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ project('meson-sqlite', 'cpp',
'cpp_std=c++14'])

# Set up dependencies
sqlite_proj = subproject('sqlite')
sqlite_dep = sqlite_proj.get_variable('sqlite_dep')
sqlite_dep = dependency('sqlite3', required : false)

if not sqlite_dep.found()
sqlite_proj = subproject('sqlite')
sqlite_dep = sqlite_proj.get_variable('sqlite_dep')
endif

# Compile the program
exe = executable('sqlite-test', 'sqlite-test.cpp',
Expand Down

0 comments on commit 1fc1f9b

Please sign in to comment.