Skip to content

Commit

Permalink
Fix build flags for Apple builds
Browse files Browse the repository at this point in the history
A previous change made `UNIX` and `APPLE` build flags mutually
exclusive instead of complementary. This broke builds on, e.g., Mac OS
X.

The changes in this commit will make builds work on Mac OS X again.
  • Loading branch information
erimatnor committed Nov 4, 2019
1 parent 90cab8e commit 1e75c27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/build-defs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ if(UNIX)
set(CMAKE_C_FLAGS "${PG_CFLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${PG_CPPFLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
elseif(APPLE)
endif ()

if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -multiply_defined suppress")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -multiply_defined suppress -Wl,-undefined,dynamic_lookup -bundle_loader ${PG_BINDIR}/postgres")
elseif (WIN32)
Expand Down
4 changes: 3 additions & 1 deletion tsl/src/build-defs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ if (UNIX)
set(CMAKE_C_FLAGS "${PG_CFLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${PG_CPPFLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
elseif(APPLE)
endif()

if(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -multiply_defined suppress")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -multiply_defined suppress -Wl,-undefined,dynamic_lookup -bundle_loader ${PG_BINDIR}/postgres")
elseif(WIN32)
Expand Down

0 comments on commit 1e75c27

Please sign in to comment.