@@ -448,11 +448,11 @@ set(IOTJS_INCLUDE_DIRS
448448
449449if (NOT BUILD_LIB_ONLY)
450450 if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
451- iotjs_add_link_flags("-Xlinker -map -Xlinker iotjs.map" )
451+ iotjs_add_link_flags(-Wl, -map, iotjs.map)
452452 elseif (USING_MSVC)
453- iotjs_add_link_flags("/ MAP:iotjs.map" )
453+ iotjs_add_link_flags("- MAP:iotjs.map" )
454454 else ()
455- iotjs_add_link_flags(" -Xlinker -Map -Xlinker iotjs.map" )
455+ iotjs_add_link_flags(-Xlinker -Map= iotjs.map)
456456 endif ()
457457endif ()
458458
@@ -515,22 +515,17 @@ else()
515515 file (READ "${IOTJS_SOURCE_DIR} /napi/node_symbols.txt" NODE_SYMBOLS)
516516 string (REGEX REPLACE "[\r |\n ]" ";" NODE_SYMBOLS "${NODE_SYMBOLS} " )
517517
518- if (USING_MSVC)
519- set (NODE_SYMBOL_SEPARATOR " /INCLUDE:" )
520- if ("${TARGET_ARCH} " STREQUAL "i686" )
521- set (NODE_SYMBOL_SEPARATOR "${NODE_SYMBOL_SEPARATOR} _" )
522- endif ()
523- else ()
524- set (NODE_SYMBOLS_LINK_FLAGS "-Wl" )
525- set (NODE_SYMBOL_SEPARATOR ",-u," )
526- endif ()
527-
528518 foreach (NODE_SYMBOL ${NODE_SYMBOLS} )
529- set (NODE_SYMBOLS_LINK_FLAGS
530- "${NODE_SYMBOLS_LINK_FLAGS}${NODE_SYMBOL_SEPARATOR}${NODE_SYMBOL} " )
531- endforeach ()
532-
533- iotjs_add_link_flags(${NODE_SYMBOLS_LINK_FLAGS} )
519+ if (USING_MSVC)
520+ if ("${TARGET_ARCH} " STREQUAL "i686" )
521+ iotjs_add_link_flags("/INCLUDE:_${NODE_SYMBOL} " )
522+ else ()
523+ iotjs_add_link_flags("/INCLUDE:${NODE_SYMBOL} " )
524+ endif ()
525+ else ()
526+ iotjs_add_link_flags("-Wl,-u,${NODE_SYMBOL} " )
527+ endif ()
528+ endforeach ()
534529 endif ()
535530endif (CREATE_SHARED_LIB)
536531
0 commit comments