Skip to content

Commit

Permalink
Switch to CMake build (#3)
Browse files Browse the repository at this point in the history
* Try using cmake strategy

* Add cmake dependency

* Add CXX compiler

* Switch Linux / OSX to use cmake, too

* Add dependency

* Add wait for travis

* Link math library

* Add cocoa framework

* Add switch for osx / linux

* Revert "Switch Linux / OSX to use cmake, too"

This reverts commit 09a99e7.
  • Loading branch information
bryphe authored Nov 7, 2018
1 parent 6c71e3b commit 33a981e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install:
- npm install --global [email protected]
- esy install
script:
- esy build
- travis_wait 40 esy build
cache:
timeout: 360
directories:
Expand Down
7 changes: 6 additions & 1 deletion esy/configure-windows.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
cd _build
./configure --prefix=$cur__install --host=x86_64-w64-mingw32

INSTALL_PATH="$(cygpath -u $cur__install)"

echo "Install: $INSTALL_PATH"

cmake -G "Unix Makefiles" ../harfbuzz-1.9.0 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_LINKER=/usr/bin/x86_64-w64-mingw32-ld -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH
8 changes: 7 additions & 1 deletion esy/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ if which x86_64-w64-mingw32-gcc; then
# Copy runtime mingw files
BUILDDIR=$(pwd)/esy
cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll $BUILDDIR/.
ADDITIONAL_LIBS=
else
CC=gcc
BUILDDIR=$(pwd)/_build
if [ "$(uname)" == "Darwin"]; then
ADDITIONAL_LIBS=-framework Foundation
else
ADDITIONAL_LIBS=-lm
fi
fi

echo "Using build directory: $BUILDDIR"
Expand All @@ -31,5 +37,5 @@ cp $cur__bin/*.dll .
export PATH=$PATH:$cur__bin:$cur__lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$cur__lib

$CC $ROOTDIR/esy/test.c -o test.exe -std=c99 -I$INCLUDE -L$cur__lib -lharfbuzz
$CC $ROOTDIR/esy/test.c -o test.exe -std=c99 -I$INCLUDE -L$cur__lib -lharfbuzz $ADDITIONAL_LIBS
./test.exe $ROOTDIR/esy/Roboto-Regular.ttf "test=>text"
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,12 @@
}
},
"dependencies": {
"esy-cmake": "*"
},
"resolutions": {
"esy-cmake": "github:bryphe/esy-cmake#5a40a8e"
},
"devDependencies": {
"esy-cmake": "*"
}
}

0 comments on commit 33a981e

Please sign in to comment.