Skip to content

Commit

Permalink
Move install step of nodejs built from source from cmake script to no…
Browse files Browse the repository at this point in the history
…de loader install phase.
  • Loading branch information
viferga committed Jan 31, 2024
1 parent f182ff2 commit 4d90d34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cmake/FindNodeJS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,6 @@ if(NOT NodeJS_LIBRARY)
# Copy library to MetaCall output path
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_OUTPUT_DIR})
file(COPY "${NodeJS_COMPILE_PATH}/${NodeJS_LIBRARY_NAME}" DESTINATION ${PROJECT_OUTPUT_DIR})

message(STATUS "Install NodeJS shared library")
endif()
else()
message(STATUS "Configure NodeJS shared library")
Expand Down Expand Up @@ -553,10 +551,6 @@ if(NOT NodeJS_LIBRARY)
else()
execute_process(COMMAND sh -c "make -C out BUILDTYPE=${CMAKE_BUILD_TYPE} V=1" WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}")
endif()

message(STATUS "Install NodeJS shared library")

execute_process(COMMAND sh -c "make install" WORKING_DIRECTORY "${NodeJS_OUTPUT_PATH}")
endif()
endif()

Expand All @@ -576,6 +570,8 @@ if(NOT NodeJS_LIBRARY)

if(NOT NodeJS_LIBRARY)
message(FATAL_ERROR "NodeJS library not found and it could not be built from source")
else()
set(NodeJS_BUILD_FROM_SOURCE TRUE)
endif()
endif()

Expand Down
6 changes: 6 additions & 0 deletions source/loaders/node_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,10 @@ if(NodeJS_LIBRARY_NAME_PATH AND WIN32)
DESTINATION ${INSTALL_LIB}
COMPONENT runtime
)
elseif(NodeJS_BUILD_FROM_SOURCE AND NOT WIN32)
install(FILES
"${NodeJS_LIBRARY}"
DESTINATION ${INSTALL_LIB}
COMPONENT runtime
)
endif()

0 comments on commit 4d90d34

Please sign in to comment.