Skip to content

Commit

Permalink
Fix build on Linux when compiled with FORCE_STATIC_LIBS
Browse files Browse the repository at this point in the history
In #44326 the build system changes made POSTGRES_INCLUDE_DIR a PRIVATE include, so this
include directory does not get propagated, but then qgis_core fails to build due to transitive
include of libpq-fe.h:

In file included from ../src/providers/postgres/qgspostgresprovider.h:23,
                 from ../src/core/providers/qgsproviderregistry.cpp:58:
../src/providers/postgres/qgspostgresconn.h:35:10: fatal error: libpq-fe.h: No such file or directory

On other platforms such as Mac this does not seem to be an issue, because PostgreSQL include
directory is the same as other include directories, but at least on Ubuntu the include directory
is /usr/include/postgresql
  • Loading branch information
wonder-sk authored and github-actions[bot] committed Nov 17, 2021
1 parent 955fcb8 commit 1228822
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/postgres/CMakeLists.txt
Expand Up @@ -40,7 +40,7 @@ set(PG_HDRS
# static library
add_library (provider_postgres_a STATIC ${PG_SRCS} ${PG_HDRS})

target_include_directories(provider_postgres_a SYSTEM PRIVATE
target_include_directories(provider_postgres_a SYSTEM PUBLIC
${POSTGRES_INCLUDE_DIR}
)

Expand Down

0 comments on commit 1228822

Please sign in to comment.