Skip to content

Commit dcb1871

Browse files
authored
Windows runtime files (#130)
* Added Windows runtime redistributable files * Added post build step to copy redistributable libs * Refined npmignore regarding Windows build output * Excluded dependencies and config folders from npm package * Explicitly list 3rd party files for Windows build since it fails on wildcard
1 parent 9f366a9 commit dcb1871

8 files changed

+23
-3
lines changed

Diff for: .npmignore

+7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
.idea
22
.vscode
3+
.build
4+
.github
5+
3rdparty
36
build/CMakeFiles
47
build/cmake_install.cmake
58
build/CMakeCache.txt
69
build/Makefile
10+
build/*.vcxproj*
11+
build/*.sln
12+
build/x64/
13+
build/libnut.dir/
714
CMakeFiles
815
src
916
test

Diff for: 3rdparty/win32/api-ms-win-crt-heap-l1-1-0.dll

19.3 KB
Binary file not shown.

Diff for: 3rdparty/win32/api-ms-win-crt-runtime-l1-1-0.dll

21.9 KB
Binary file not shown.

Diff for: 3rdparty/win32/api-ms-win-crt-string-l1-1-0.dll

24.3 KB
Binary file not shown.

Diff for: 3rdparty/win32/msvcp140.dll

618 KB
Binary file not shown.

Diff for: 3rdparty/win32/vcruntime140.dll

85.8 KB
Binary file not shown.

Diff for: 3rdparty/win32/vcruntime140_1.dll

37.4 KB
Binary file not shown.

Diff for: CMakeLists.txt

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.12)
1+
cmake_minimum_required(VERSION 3.20)
22
set(CMAKE_CXX_STANDARD 17)
33

44
project(libnut)
@@ -26,8 +26,6 @@ elseif (WIN32)
2626
message(STATUS "Windows build")
2727
elseif (UNIX AND NOT APPLE)
2828
message(STATUS "Linux build")
29-
set(LIBS "${LIBS}" "-lpng")
30-
set(LIBS "${LIBS}" "-lz")
3129
set(LIBS "${LIBS}" "-lX11")
3230
set(LIBS "${LIBS}" "-lXtst")
3331
endif()
@@ -40,6 +38,21 @@ else()
4038
set(CMAKE_CXX_FLAGS "/Wall /W4 /EHsc")
4139
endif()
4240

41+
if (WIN32)
42+
# Copy runtime distributable
43+
add_custom_command(
44+
TARGET ${PROJECT_NAME} POST_BUILD
45+
COMMAND ${CMAKE_COMMAND} -E copy
46+
${CMAKE_SOURCE_DIR}/3rdparty/win32/msvcp140.dll
47+
${CMAKE_SOURCE_DIR}/3rdparty/win32/vcruntime140.dll
48+
${CMAKE_SOURCE_DIR}/3rdparty/win32/vcruntime140_1.dll
49+
${CMAKE_SOURCE_DIR}/3rdparty/win32/api-ms-win-crt-heap-l1-1-0.dll
50+
${CMAKE_SOURCE_DIR}/3rdparty/win32/api-ms-win-crt-runtime-l1-1-0.dll
51+
${CMAKE_SOURCE_DIR}/3rdparty/win32/api-ms-win-crt-string-l1-1-0.dll
52+
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/
53+
)
54+
endif()
55+
4356
add_compile_definitions(NAPI_CPP_EXCEPTIONS)
4457
add_compile_definitions(NAPI_VERSION=3)
4558

0 commit comments

Comments
 (0)