aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml36
-rw-r--r--CMakeLists.txt16
2 files changed, 45 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..3ddfeb2
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,36 @@
+# Template from https://github.com/flycheck/emacs-travis
+
+language: c
+sudo: required
+dist: trusty
+cache:
+ - directories:
+ - "$HOME/emacs/"
+
+addons:
+ apt:
+ packages:
+ - bzr
+
+matrix:
+ fast_finish: true
+
+env:
+ - EMACS_VERSION=25.3
+ - EMACS_VERSION=26.1
+
+before_install:
+ - export PATH="$HOME/bin:$PATH"
+ - wget 'https://raw.githubusercontent.com/flycheck/emacs-travis/master/emacs-travis.mk'
+ - make -f emacs-travis.mk EMACSCONFFLAGS="--with-x-toolkit=no --without-x --without-all --with-xml2 --with-modules CFLAGS='-O2 -march=native' CXXFLAGS='-O2 -march=native'" install_emacs
+ # libvterm
+ - bzr branch lp:libvterm $HOME/libvterm
+ - make -C "$HOME/libvterm" CFLAGS='-O2' PREFIX='/usr'
+ - sudo make -C "$HOME/libvterm" install
+
+script:
+ - mkdir build
+ - cd build
+ - cmake ..
+ - make
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5a3ae0..5fb973b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,8 +4,8 @@ project(emacs-libvterm C)
# Look for the header file.
find_path(LIBVTERM_INCLUDE_DIR NAMES
- vterm.h
- )
+ vterm.h
+ )
if(NOT LIBVTERM_INCLUDE_DIR)
message(FATAL_ERROR "vterm.h not found")
@@ -14,7 +14,7 @@ endif()
find_library(LIBVTERM_LIBRARY NAMES
vterm
libvterm
-)
+ )
if(NOT LIBVTERM_LIBRARY)
message(FATAL_ERROR "libvterm not found")
@@ -23,9 +23,11 @@ endif()
include_directories(${LIBVTERM_INCLUDE_DIR})
add_library(vterm-module MODULE vterm-module.c utf8.c elisp.c)
-set_property(TARGET vterm-module PROPERTY POSITION_INDEPENDENT_CODE ON)
-set_target_properties(vterm-module PROPERTIES PREFIX "")
-set_target_properties(vterm-module PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
+set_target_properties(vterm-module PROPERTIES
+ C_STANDARD 99
+ POSITION_INDEPENDENT_CODE ON
+ PREFIX ""
+ )
# Link with libvterm
target_link_libraries(vterm-module ${LIBVTERM_LIBRARY})
@@ -34,5 +36,5 @@ target_link_libraries(vterm-module ${LIBVTERM_LIBRARY})
add_custom_target(run
COMMAND emacs -Q -L ${CMAKE_SOURCE_DIR} --eval "\\(require \\'vterm\\)" --eval "\\(vterm\\)"
DEPENDS vterm-module
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)