SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
251 stars 73 forks source link

Build fails in case environment variable 'NODE_HEADERS_INCLUDE_DIR' is set #167

Closed Alexlambertz closed 4 years ago

Alexlambertz commented 4 years ago

We experienced the issue that building the node-rfc library on Windows failed giving the following errors:

info RUN cmake --build "E:\Temporary Files\node-rfc2\node_modules\node-rfc\build" --config Release

Microsoft (R) Build Engine version 15.8.169+g1ccb72aefa for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System

  Building Custom Rule E:/Temporary Files/node-rfc2/node_modules/node-rfc/CMakeLists.txt
  Client.cc
e:\temporary files\node-rfc2\node_modules\node-rfc\src\Client.h(9): fatal error C1083: Cannot open include file: 'uv.h': No such file or directory [E:\Temporary Files\node-rfc2\node_modules\node-rfc\build\sapnwrfc.vcxproj]
  nwrfcsdk.cc
E:\Temporary Files\node-rfc2\node_modules\node-rfc\node_modules\node-addon-api\napi.h(4): fatal error C1083: Cannot open include file: 'node_api.h': No such file or directory [E:\Temporary Files\node-rfc2\node_modules\node-rfc\build\sapnwrfc.vcxproj]
  Pool.cc
e:\temporary files\node-rfc2\node_modules\node-rfc\src\Pool.h(9): fatal error C1083: Cannot open include file: 'uv.h': No such file or directory [E:\Temporary Files\node-rfc
2\node_modules\node-rfc\build\sapnwrfc.vcxproj]
  Throughput.cc
E:\Temporary Files\node-rfc2\node_modules\node-rfc\node_modules\node-addon-api\napi.h(4): fatal error C1083: Cannot open include file: 'node_api.h': No such file or directory [E:\Temporary Files\node-rfc2\node_modules\node-rfc\build\sapnwrfc.vcxproj]
  Server.cc
e:\temporary files\node-rfc2\node_modules\node-rfc\src\Server.h(8): fatal error C1083: Cannot open include file: 'uv.h': No such file or directory [E:\Temporary Files\node-rfc2\node_modules\node-rfc\build\sapnwrfc.vcxproj]
  addon.cc
e:\temporary files\node-rfc2\node_modules\node-rfc\src\Client.h(9): fatal error C1083: Cannot open include file: 'uv.h': No such file or directory [E:\Temporary Files\node-rfc2\node_modules\node-rfc\build\sapnwrfc.vcxproj]

The reason was that we defined the node headers directory using the environment variable 'NODE_HEADERS_INCLUDE_DIR'. Doing so the includes aren't working correctly during build.

This refers to the CMakeLists.txt file that only checks if the environment variable is set but does not initialize the variable used later on.

vinibiscolla commented 2 years ago

Hey guys, how are you doing ?

Any updates on this ?

I just did a git clone from - https://www.npmjs.com/package/node-rfc everything all right well seted and running up but this CMakeLists.txt file problem still happening: image

I've could make this lib work already in a while late back in 2017 and right now i need to work with that again, but a lot of things has changed, so if you guys could give a light about would be trully appreciated !

Thanks a lot. Regards.