Skip to content

Commit

Permalink
Improved cmake --buiild for windows as well. Fix compile error.
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 committed Dec 13, 2023
1 parent 05c8b29 commit e0b3df1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
11 changes: 5 additions & 6 deletions scripts/build-win-prod.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env bash
# By: Melroy van den Berg
# Description: Build Windows 64-bit production release

rm -rf build_prod_win
mkdir build_prod_win
x86_64-w64-mingw32.static-cmake -GNinja -DDOXYGEN:BOOL=FALSE -DCMAKE_BUILD_TYPE=Release -B build_prod_win
x86_64-w64-mingw32.static-cmake --build ./build_prod_win --config Release
# Build packages
cd build_prod_win

x86_64-w64-mingw32.static-cmake -G Ninja -DDOXYGEN:BOOL=FALSE -DCMAKE_BUILD_TYPE=Release .. &&
ninja &&
cpack -C Release -G NSIS
# For some reason it couldn't find the makensis binary, hence the -D option
cpack -D CPACK_NSIS_EXECUTABLE=/usr/bin/makensis -C Release -G NSIS
12 changes: 2 additions & 10 deletions scripts/build-win.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
#!/usr/bin/env bash
# By: Melroy van den Berg
# Description: Development build Windows 64-bit

if [ ! -d "build_win" ]; then
echo "Creating build directory..."
mkdir build_win
fi

if [ -z "$(ls build_win)" ]; then
echo "INFO: Run cmake & ninja"
cd build_win
x86_64-w64-mingw32.static-cmake -G Ninja ..
x86_64-w64-mingw32.static-cmake -GNinja -B build_win
else
echo "INFO: Only run ninja..."
cd build_win
fi
ninja
x86_64-w64-mingw32.static-cmake --build ./build_win
2 changes: 1 addition & 1 deletion src/ipfs-daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ int IPFSDaemon::get_pid() const
if (pid_ == 0)
return 0;
#ifdef _WIN32
return GetProcessId(pid);
return GetProcessId(pid_);
#else
return pid_;
#endif
Expand Down

0 comments on commit e0b3df1

Please sign in to comment.