diff --git a/.gitignore b/.gitignore index d395fa6..f2cacec 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ build/ prebuilds/ h3/ -yarn.lock \ No newline at end of file +yarn.lock +package-lock.json diff --git a/.prebuild.sh b/.prebuild.sh index a8e65fc..be60e78 100755 --- a/.prebuild.sh +++ b/.prebuild.sh @@ -1,23 +1,27 @@ #!/bin/bash set -vex; + +COMMON_CMAKE_ARGS=-DCMAKE_BUILD_TYPE=Release + npm run clean && git clone https://github.com/uber/h3 && cd h3 && git checkout v3.6.2 && if command -v make; then if [[ "${ARCH}" == "ia32" ]]; then - cmake . -DCMAKE_C_FLAGS="-fPIC -m32" && make h3; + cmake . ${COMMON_CMAKE_ARGS} -DCMAKE_C_FLAGS="-fPIC -m32"; else - cmake . -DCMAKE_C_FLAGS=-fPIC && make h3; + cmake . ${COMMON_CMAKE_ARGS} -DCMAKE_C_FLAGS=-fPIC; fi else if [[ "${Platform}" == "x64" ]]; then - cmake . -DCMAKE_VS_PLATFORM_NAME=${Platform} -G "Visual Studio 14 Win64" && msbuild.exe h3.vcxproj; + cmake . ${COMMON_CMAKE_ARGS} -DCMAKE_VS_PLATFORM_NAME=${Platform} -G "Visual Studio 14 Win64"; else - cmake . -DCMAKE_VS_PLATFORM_NAME=${Platform} && msbuild.exe h3.vcxproj; + cmake . ${COMMON_CMAKE_ARGS} -DCMAKE_VS_PLATFORM_NAME=${Platform}; fi fi && + cmake --build . --target h3 --config Release && cd .. && prebuildify --target=node@`node --version | sed s/v//`