Skip to content

Commit

Permalink
Merge pull request #5845 from offroad-bis/master
Browse files Browse the repository at this point in the history
Fix Undefined symbols compile error on macOS.
  • Loading branch information
rouault committed Aug 23, 2019
2 parents b1828e1 + 02b6aa3 commit 37fa8e0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mapscript/phpng/CMakeLists.txt
Expand Up @@ -62,6 +62,20 @@ if(WIN32)
SWIG_LINK_LIBRARIES(php_mapscriptng ${PHP_LIBRARY})
endif(WIN32)

IF(APPLE)
if(XCODE)
SET(CMAKE_C_LINK_FLAGS
"${CMAKE_C_LINK_FLAGS} -undefined dynamic_lookup")
SET(CMAKE_CXX_LINK_FLAGS
"${CMAKE_CXX_LINK_FLAGS} -undefined dynamic_lookup")
else(XCODE)
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -undefined dynamic_lookup")
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS
"${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -undefined dynamic_lookup")
endif(XCODE)
ENDIF(APPLE)

# hide "defined but not used" warnings
target_compile_options(php_mapscriptng PRIVATE -Wno-unused-label)

Expand Down

0 comments on commit 37fa8e0

Please sign in to comment.