Skip to content

Windows runtime files #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
.idea
.vscode
.build
.github
3rdparty
build/CMakeFiles
build/cmake_install.cmake
build/CMakeCache.txt
build/Makefile
build/*.vcxproj*
build/*.sln
build/x64/
build/libnut.dir/
CMakeFiles
src
test
Expand Down
Binary file added 3rdparty/win32/api-ms-win-crt-heap-l1-1-0.dll
Binary file not shown.
Binary file added 3rdparty/win32/api-ms-win-crt-runtime-l1-1-0.dll
Binary file not shown.
Binary file added 3rdparty/win32/api-ms-win-crt-string-l1-1-0.dll
Binary file not shown.
Binary file added 3rdparty/win32/msvcp140.dll
Binary file not shown.
Binary file added 3rdparty/win32/vcruntime140.dll
Binary file not shown.
Binary file added 3rdparty/win32/vcruntime140_1.dll
Binary file not shown.
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 17)

project(libnut)
Expand Down Expand Up @@ -26,8 +26,6 @@ elseif (WIN32)
message(STATUS "Windows build")
elseif (UNIX AND NOT APPLE)
message(STATUS "Linux build")
set(LIBS "${LIBS}" "-lpng")
set(LIBS "${LIBS}" "-lz")
set(LIBS "${LIBS}" "-lX11")
set(LIBS "${LIBS}" "-lXtst")
endif()
Expand All @@ -40,6 +38,21 @@ else()
set(CMAKE_CXX_FLAGS "/Wall /W4 /EHsc")
endif()

if (WIN32)
# Copy runtime distributable
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/3rdparty/win32/msvcp140.dll
${CMAKE_SOURCE_DIR}/3rdparty/win32/vcruntime140.dll
${CMAKE_SOURCE_DIR}/3rdparty/win32/vcruntime140_1.dll
${CMAKE_SOURCE_DIR}/3rdparty/win32/api-ms-win-crt-heap-l1-1-0.dll
${CMAKE_SOURCE_DIR}/3rdparty/win32/api-ms-win-crt-runtime-l1-1-0.dll
${CMAKE_SOURCE_DIR}/3rdparty/win32/api-ms-win-crt-string-l1-1-0.dll
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/
)
endif()

add_compile_definitions(NAPI_CPP_EXCEPTIONS)
add_compile_definitions(NAPI_VERSION=3)

Expand Down