ENH: remove the -flat_namespace and -undefined suppress hacks from
ENH: CMAKE_SHARED_MODULE_CREATE_C_FLAGS ENH: and fix the complex example to specify a -bundle loader for the ENH: shared module that it builds.
This commit is contained in:
parent
44429c46c0
commit
2ff4690192
|
@ -5,7 +5,7 @@ SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
|
|||
SET(CMAKE_MODULE_EXISTS 1)
|
||||
SET(CMAKE_DL_LIBS "")
|
||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib")
|
||||
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -flat_namespace -undefined suppress")
|
||||
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle")
|
||||
|
||||
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||
|
|
|
@ -46,6 +46,9 @@ ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
|||
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
|
||||
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
|
||||
GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(CMakeTestModule PROPERTIES LINK_FLAGS "-bundle_loader ${Complex_BINARY_DIR}/bin/create_file")
|
||||
ENDIF(APPLE)
|
||||
IF(${FOO_BAR_VAR} MATCHES "BAR")
|
||||
ELSE(${FOO_BAR_VAR} MATCHES "BAR")
|
||||
MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
|
||||
|
|
|
@ -46,6 +46,9 @@ ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
|||
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
|
||||
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
|
||||
GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(CMakeTestModule PROPERTIES LINK_FLAGS "-bundle_loader ${Complex_BINARY_DIR}/bin/create_file")
|
||||
ENDIF(APPLE)
|
||||
IF(${FOO_BAR_VAR} MATCHES "BAR")
|
||||
ELSE(${FOO_BAR_VAR} MATCHES "BAR")
|
||||
MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
|
||||
|
|
|
@ -46,6 +46,9 @@ ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c)
|
|||
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR)
|
||||
SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm")
|
||||
GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO)
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(CMakeTestModule PROPERTIES LINK_FLAGS "-bundle_loader ${Complex_BINARY_DIR}/bin/create_file")
|
||||
ENDIF(APPLE)
|
||||
IF(${FOO_BAR_VAR} MATCHES "BAR")
|
||||
ELSE(${FOO_BAR_VAR} MATCHES "BAR")
|
||||
MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}")
|
||||
|
|
Loading…
Reference in New Issue