Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Undefined symbols compile error on macOS.
Added block of code defining -undefined dynamic_lookup for a LINK_FLAG to fix Undefined symbols for architecture x86_64: error when compiling.  Code block was taken directly from the CMakeLists.txt file located in the mapscript/php directory.
  • Loading branch information
offroad-bis committed Aug 16, 2019
1 parent cdde556 commit 5be2764
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 5be2764

Please sign in to comment.