Skip to content

Commit

Permalink
add cmake build
Browse files Browse the repository at this point in the history
Summary:
This is a reasonably functional cmake implementation
of the watchman build system.  Notably missing is support for
detecting pcre and linking it in; that can be done in a follow-up
diff.

This replaces the hand-rolled windows build bits completely,
but does not remove the autoconf bits.  I will likely remove
autoconf once we have parity.

The intent is that this is a stepping stone to adding a dependency
on folly.

When testing the windows build, I found that watchman was missing most of its
registered commands.

It appears as though the relatively tricky constructor attributes that we're
using (which were targeting the `C` compiler) no longer stick; the symbols are
not included in the build and the commands are missing.

The resolution is to use C++ constructor syntax for these instead.

I also tried this on Linux and Mac because it is appealing to
simplify everything, but various versions of gcc/clang on the OSS
CI failed to link in all the commands.

I've adjusted the configuration for the various CI systems so that
we run both autoconf and cmake based builds and tests.  In the longer
run I will remove the autoconf version of the build.

Reviewed By: simpkins

Differential Revision: D7363633

Pulled By: wez

fbshipit-source-id: ac00ae0cd7af5bc51cdcf72c0595c280a4a3f977
  • Loading branch information
wez authored and facebook-github-bot committed Mar 29, 2018
1 parent a47bd93 commit e6350f9
Show file tree
Hide file tree
Showing 21 changed files with 671 additions and 262 deletions.
11 changes: 9 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ defaults: &defaults
- checkout
- run:
name: Install dependencies
command: apt-get update && apt-get install libtool m4 automake npm -y
- run: ./travis/run.sh
command: apt-get update && apt-get install cmake libtool m4 automake npm -y
- run:
environment:
USE_CMAKE: 1
command: ./travis/run.sh
- run:
environment:
USE_CMAKE: 0
command: ./travis/run.sh

version: 2
jobs:
Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ buck-cache
/thirdparty/jansson/jansson_config.h
/compile
/tests/*.t
/*.t
.dirstamp
*.a
/tests/integration/.watchman.*
Expand Down Expand Up @@ -81,3 +82,15 @@ cppclient/watchmanclient.pc
/website/.jekyll-metadata
/rust/**/Cargo.lock
/rust/**/target/
/CMakeCache.txt
/CMakeFiles
/*.cmake
/Testing
/install_manifest.txt
*.vcxproj
*.dir
/x64
/Release
/Debug
*.filters
/.vs
36 changes: 9 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ addons:
- deadsnakes
- ubuntu-toolchain-r-test
packages:
- php5-cli
- cmake
- python2.7
- python2.7-dev
- python3.5
- python3.5-dev
- python3.6
- python3.6-dev
- gcc-4.8
- g++-4.8
- gcc-5
- g++-5
- gcc-6
- g++-6
# - ruby
# - rubygems
# - valgrind

branches:
only:
Expand All @@ -43,39 +40,24 @@ branches:
# http://www.drmaciver.com/2015/10/a-whirlwind-tour-of-the-hypothesis-build/
matrix:
include:
- os: osx
env: TRAVIS_PYTHON=python2.6
- os: osx
env: TRAVIS_PYTHON=python2.7
- os: osx
env: TRAVIS_PYTHON=python3.5
- os: osx
osx_image: xcode7.3
env: TRAVIS_PYTHON=python2.7 ENABLE_ASAN=1
env: TRAVIS_PYTHON=python2.6 OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ USE_CMAKE=1
- os: osx
osx_image: xcode7.3
env: TRAVIS_PYTHON=python3.5 ENABLE_ASAN=1
- os: osx
osx_image: xcode8.3
env: TRAVIS_PYTHON=python3.6 ENABLE_ASAN=1
env: TRAVIS_PYTHON=python3.5 OPENSSL_ROOT_DIR=/usr/local/opt/openssl/ USE_CMAKE=1
- os: linux
env: TRAVIS_PYTHON=python2.7 ENABLE_ASAN=1 CXX=g++-5
compiler: gcc-5
env: USE_CMAKE=1 CXX=g++-6 TRAVIS_PYTHON=python3.6
compiler: gcc-6
- os: linux
env: TRAVIS_PYTHON=python3.5 ENABLE_ASAN=1 CXX=g++-5
env: USE_CMAKE=1 CXX=g++-5 TRAVIS_PYTHON=python3.5
compiler: gcc-5
- os: linux
env: TRAVIS_PYTHON=python3.6 ENABLE_ASAN=1 CXX=g++-6
env: USE_CMAKE=1 CXX=g++-6 TRAVIS_PYTHON=python2.7
compiler: gcc-6
- os: linux
env: TRAVIS_PYTHON=python2.7 CXX=g++-4.8
compiler: gcc-4.8
- os: linux
env: TRAVIS_PYTHON=python3.5 CXX=g++-4.8
compiler: gcc-4.8
- os: linux
env: TRAVIS_PYTHON=python3.6 CXX=g++-4.8
compiler: gcc-4.8
env: USE_CMAKE=0 CXX=g++-6 TRAVIS_PYTHON=python3.6
compiler: gcc-6

before_script: ./travis/deps.sh
script: ./travis/run.sh
Loading

0 comments on commit e6350f9

Please sign in to comment.