Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

integrate emscripten build

  • Loading branch information...
commit aa1fc20cb89c4c4edffc19325f6c767e50ae4b4e 1 parent f27e047
@paulfitz authored
Showing with 26 additions and 12 deletions.
  1. +24 −11 scripts/emscripten/prep_js.sh
  2. +2 −1  src/CMakeLists.txt
View
35 scripts/emscripten/prep_js.sh
@@ -1,20 +1,37 @@
-if [ ! -e coopy_source.txt ] ; then
- echo "Please run from build directory"
- exit 1
+if [ "k$1" = "k" ]; then
+
+ if [ ! -e coopy_source.txt ] ; then
+ echo "Please run from build directory"
+ exit 1
+ fi
+
+ SRC=`cat coopy_source.txt`
+ BIN="$PWD"
+else
+ SRC="$1"
+ BIN="$2"
+ cd "$3"
+ rm -f ssdiff_core.js
fi
-SRC=`cat coopy_source.txt`
+BASE=$PWD
if [ ! -e ssdiff_core.js ] ; then
- EMCC_CFLAGS="--ignore-dynamic-linking" make ssdiff || exit 1
- cp bin/ssdiff ssdiff.bc || exit 1
+ cd $BIN
+ # EMCC_CFLAGS="--ignore-dynamic-linking" make emdiff || exit 1
+ cp bin/emdiff $BASE/ssdiff.bc || exit 1
+ cd $BASE
rm -rf /tmp/emscripten_temp
# EMCC_DEBUG=1 emcc lib/libcoopy_csv_sql.so lib/libcoopy_light.so lib/libcoopy_core.so lib/libcoopy_csv.so lib/libcoopy_full.so --embed-file broken_bridges.csv --embed-file bridges.csv -O3 --llvm-opts 2 x.bc -o foo.js
- EMCC_DEBUG=1 emcc lib/libcoopy_csv_sql.so lib/libcoopy_light.so lib/libcoopy_core.so lib/libcoopy_csv.so lib/libcoopy_full.so --pre-js $SRC/scripts/emscripten/pre.js -O3 --llvm-opts 2 x.bc -o ssdiff_core.js || exit 1
+# EMCC_DEBUG=1 emcc $BIN/lib/libcoopy_csv_sql.so $BIN/lib/libcoopy_light.so $BIN/lib/libcoopy_core.so $BIN/lib/libcoopy_csv.so $BIN/lib/libcoopy_full.so --pre-js $SRC/scripts/emscripten/pre.js -O3 --llvm-opts 2 $BASE/ssdiff.bc -o ssdiff_core.js || exit 1
+
+ # EMCC_DEBUG=1 emcc $BIN/lib/libcoopy_csv_sql.so $BIN/lib/libcoopy_light.so $BIN/lib/libcoopy_core.so $BIN/lib/libcoopy_csv.so $BIN/lib/libcoopy_full.so --pre-js $SRC/scripts/emscripten/pre.js $BASE/ssdiff.bc -o ssdiff_core.js || exit 1
+
+ EMCC_DEBUG=1 emcc --pre-js $SRC/scripts/emscripten/pre.js $BASE/ssdiff.bc -o ssdiff_core.js || exit 1
fi
@@ -39,15 +56,11 @@ cat <<EOF
<html>
<head>
<title>Testing ssdiff.js</title>
-<link href='http://fonts.googleapis.com/css?family=Just+Me+Again+Down+Here' rel='stylesheet' type='text/css' />
<style>
textarea {
width:300px; height:75px;
background:ffc;
}
-body {
- font-family: 'Just Me Again Down Here', cursive;
-}
</style>
</head>
View
3  src/CMakeLists.txt
@@ -29,6 +29,7 @@ option(USE_JACKCESS "Enable Jackcess (experimental)" OFF)
option(CREATE_SHARED_LIBRARIES "Compile shared libraries rather than static" TRUE)
option(JUST_HIGHLIGHT "Pare down for highlighter diffs only" OFF)
option(EMBED_GETOPT "Embed getopt_long" OFF)
+option(USE_EMSCRIPTEN "Add targets useful with Emscripten" OFF)
if (CREATE_SHARED_LIBRARIES)
set(BUILD_SHARED_LIBS ON)
if (UNIX)
@@ -106,8 +107,8 @@ add_subdirectory(ssfold)
add_subdirectory(ssfossil)
add_subdirectory(widesheet)
add_subdirectory(gui)
-
add_subdirectory(light)
+add_subdirectory(emcc)
SET(TESTS ${CMAKE_SOURCE_DIR}/tests)
set(TEST_STORE ${CMAKE_CURRENT_BINARY_DIR}/test_store)
Please sign in to comment.
Something went wrong with that request. Please try again.