@@ -446,11 +446,11 @@ set(IOTJS_INCLUDE_DIRS
446446
447447if (NOT BUILD_LIB_ONLY)
448448 if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
449- iotjs_add_link_flags("-Xlinker -map -Xlinker iotjs.map" )
449+ iotjs_add_link_flags(-Wl, -map, iotjs.map)
450450 elseif (USING_MSVC)
451- iotjs_add_link_flags("/ MAP:iotjs.map" )
451+ iotjs_add_link_flags("- MAP:iotjs.map" )
452452 else ()
453- iotjs_add_link_flags(" -Xlinker -Map -Xlinker iotjs.map" )
453+ iotjs_add_link_flags(-Xlinker -Map= iotjs.map)
454454 endif ()
455455endif ()
456456
@@ -513,22 +513,21 @@ else()
513513 file (READ "${IOTJS_SOURCE_DIR} /napi/node_symbols.txt" NODE_SYMBOLS)
514514 string (REGEX REPLACE "[\r |\n ]" ";" NODE_SYMBOLS "${NODE_SYMBOLS} " )
515515
516- if (USING_MSVC)
517- set (NODE_SYMBOL_SEPARATOR " /INCLUDE:" )
518- if ("${TARGET_ARCH} " STREQUAL "i686" )
519- set (NODE_SYMBOL_SEPARATOR "${NODE_SYMBOL_SEPARATOR} _" )
520- endif ()
521- else ()
522- set (NODE_SYMBOLS_LINK_FLAGS "-Wl" )
523- set (NODE_SYMBOL_SEPARATOR ",-u," )
524- endif ()
525-
526516 foreach (NODE_SYMBOL ${NODE_SYMBOLS} )
527- set (NODE_SYMBOLS_LINK_FLAGS
528- "${NODE_SYMBOLS_LINK_FLAGS}${NODE_SYMBOL_SEPARATOR}${NODE_SYMBOL} " )
529- endforeach ()
530-
531- iotjs_add_link_flags(${NODE_SYMBOLS_LINK_FLAGS} )
517+ if (USING_MSVC)
518+ if ("${TARGET_ARCH} " STREQUAL "i686" )
519+ iotjs_add_link_flags("/INCLUDE:_${NODE_SYMBOL} " )
520+ else ()
521+ iotjs_add_link_flags("/INCLUDE:${NODE_SYMBOL} " )
522+ endif ()
523+ else ()
524+ if ("${TARGET_OS} " STREQUAL "DARWIN" )
525+ iotjs_add_link_flags("-Wl,-u,_${NODE_SYMBOL} " )
526+ else ()
527+ iotjs_add_link_flags("-Wl,-u,${NODE_SYMBOL} " )
528+ endif ()
529+ endif ()
530+ endforeach ()
532531 endif ()
533532endif (CREATE_SHARED_LIB)
534533
0 commit comments