Skip to content

Commit a24899b

Browse files
authoredApr 20, 2021
Look for PostgreSQL library properly and fix CI
1 parent 1da7341 commit a24899b

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Compiling
133133
| Dependency | Version | Commentary |
134134
|------------|---------|------------|
135135
| GCC | 4.9+ | Can be replaced with Clang 3.4+ |
136-
| CMake | 2.6+ | |
136+
| CMake | 3.5+ | |
137137
| Irrlicht | - | Custom version required, see https://github.com/minetest/irrlicht |
138138
| SQLite3 | 3.0+ | |
139139
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |

‎src/CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,16 @@ option(ENABLE_POSTGRESQL "Enable PostgreSQL backend" TRUE)
146146
set(USE_POSTGRESQL FALSE)
147147

148148
if(ENABLE_POSTGRESQL)
149-
find_package("PostgreSQL")
149+
if(CMAKE_VERSION VERSION_LESS "3.20")
150+
find_package(PostgreSQL QUIET)
151+
# Before CMake 3.20 FindPostgreSQL.cmake always looked for server includes
152+
# but we don't need them, so continue anyway if only those are missing.
153+
if(PostgreSQL_INCLUDE_DIR AND PostgreSQL_LIBRARY)
154+
set(PostgreSQL_FOUND TRUE)
155+
endif()
156+
else()
157+
find_package(PostgreSQL)
158+
endif()
150159

151160
if(PostgreSQL_FOUND)
152161
set(USE_POSTGRESQL TRUE)

‎util/ci/common.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ install_linux_deps() {
55
local pkgs=(cmake libpng-dev \
66
libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \
77
libhiredis-dev libogg-dev libgmp-dev libvorbis-dev libopenal-dev \
8-
gettext libpq-dev postgresql-server-dev-all libleveldb-dev \
9-
libcurl4-openssl-dev)
8+
gettext libpq-dev libleveldb-dev libcurl4-openssl-dev)
109

1110
if [[ "$1" == "--old-irr" ]]; then
1211
shift

0 commit comments

Comments
 (0)
Please sign in to comment.