Skip to content

Commit

Permalink
cross-compile onto Windows-x64
Browse files Browse the repository at this point in the history
  • Loading branch information
weltyc committed Jan 13, 2016
1 parent a6d626e commit ed63861
Show file tree
Hide file tree
Showing 28 changed files with 75 additions and 245 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ packages/

#Test files
*.testsettings
/winbuild
/build-*
/build
/winbuild/
/build-*/
/build/
/run

# Python stuf
Expand Down
30 changes: 30 additions & 0 deletions build-windows-x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Build ntest for Windows-x64

set -eu

if ! [ -e src ]
then
echo "missing source directory. Run this from within the ntest directory."
return 1
fi

echo "---------------"
echo "Compiling ntest"
echo "---------------"

mkdir -p build-windows-x64
docker run -i \
-v `pwd`/src:/usr/src:ro \
-v `pwd`/build-windows-x64:/usr/build:rw \
-u `stat -c "%u:%g" build-windows-x64` \
thewtex/cross-compiler-windows-x64 <<EOF
cd ../build
cmake -DCMAKE_BUILD_TYPE=Release ../src
make
EOF

echo
echo "---------------"
echo "BUILD SUCCEEDED"
echo "---------------"

30 changes: 11 additions & 19 deletions build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Build ntest for the local machine

set -eu

if ! [ -e src ]
then
echo "missing source directory. Run this from within the ntest directory."
Expand All @@ -8,27 +12,15 @@ echo "---------------"
echo "Compiling ntest"
echo "---------------"

mkdir build
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ../src
make
make test
cd .. # person who ran build.sh expects its working directory here

echo "---------------------------------"
echo "Copying ntest to run subdirectory"
echo "---------------------------------"

cd ..
rm -rf run
mkdir run
cp build/ntest run
cp -r resource/* run
cp -r extras run
cp -r instructions run

echo "-------------"
echo "Testing ntest"
echo "-------------"
echo
echo "---------------"
echo "BUILD SUCCEEDED"
echo "---------------"

cd run # ntest expects its working directory here
./ntest t
cd .. # person who ran build.sh expects its working directory here
116 changes: 0 additions & 116 deletions resource/endgame answers.txt

This file was deleted.

100 changes: 0 additions & 100 deletions resource/test_games.txt

This file was deleted.

8 changes: 1 addition & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ target_link_libraries(randomEvalGen mainlib core game patterns odk n64)
add_test(ntest_basic ntest o)

if(${UNIX})
EXEC_PROGRAM(ln ARGS -sf "${CMAKE_SOURCE_DIR}/../resource/coefficients"
"${CMAKE_BINARY_DIR}")
EXEC_PROGRAM(ln ARGS -sf "${CMAKE_SOURCE_DIR}/../resource/TestGames.ggf"
"${CMAKE_BINARY_DIR}")
EXEC_PROGRAM(ln ARGS -sf "${CMAKE_SOURCE_DIR}/../resource"
"${CMAKE_BINARY_DIR}")
EXEC_PROGRAM(ln ARGS -sf "${CMAKE_SOURCE_DIR}/../resource/parameters.txt"
EXEC_PROGRAM(ln ARGS -sf "../src/resource/*"
"${CMAKE_BINARY_DIR}")
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions win-x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Build ntest for Windows-x64
# on Linux
#
# Uses a docker cross-compiler which is enormous (3GB), beware.
#

set -eu

if ! [ -e src ]
then
echo "missing source directory. Run this from within the ntest directory."
return 1
fi

echo "---------------"
echo "Compiling ntest"
echo "---------------"

mkdir -p build-windows-x64
docker run -i -v `pwd`/src:/usr/src:ro -v `pwd`/build-windows-x64:/usr/build:rw thewtex/cross-compiler-windows-x64 <<EOF
cd ../build
cmake -DCMAKE_BUILD_TYPE=Release ../src
make
EOF

echo
echo "---------------"
echo "BUILD SUCCEEDED"
echo "---------------"

0 comments on commit ed63861

Please sign in to comment.