Commit 0fa80a4d authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook GitHub Bot

add a top-level build.sh to build folly via getdeps.py

Summary:
Add a small top-level build.sh script that invokes
build/fbcode_builder/getdeps.py to perform the build.  This primarily helps
make the getdeps build process more discoverable to users.

Also document this script in README.md

Reviewed By: yfeldblum

Differential Revision: D23484822

fbshipit-source-id: 6013ace6d80d7d3d80aa87d4c6269ac106814cf0
parent b3521215
...@@ -72,6 +72,33 @@ Folly is published on GitHub at https://github.com/facebook/folly ...@@ -72,6 +72,33 @@ Folly is published on GitHub at https://github.com/facebook/folly
### Build Notes ### Build Notes
Because folly does not provide any ABI compatibility guarantees from commit to
commit, we generally recommend building folly as a static library.
#### build.sh
The simplest way to build folly is using the `build.sh` script in the top-level
of the repository. `build.sh` can be used on Linux and MacOS, on Windows use
the `build.bat` script instead.
This script will download and build all of the necessary dependencies first,
and will then build folly. This will help ensure that you build with recent
versions of all of the dependent libraries, regardless of what versions are
installed locally on your system.
By default this script will build and install folly and its dependencies in a
scratch directory. You can also specify a `--scratch-path` argument to control
the location of the scratch directory used for the build. There are also
`--install-dir` and `--install-prefix` arguments to provide some more
fine-grained control of the installation directories. However, given that
folly provides no compatibility guarantees between commits we generally
recommend building and installing the libraries to a temporary location, and
then pointing your project's build at this temporary location, rather than
installing folly in the traditional system installation directories. e.g., if
you are building with CMake you can use the `CMAKE_PREFIX_PATH` variable to
allow CMake to find folly in this temporary installation directory when
building your project.
#### Dependencies #### Dependencies
folly supports gcc (5.1+), clang, or MSVC. It should run on Linux (x86-32, folly supports gcc (5.1+), clang, or MSVC. It should run on Linux (x86-32,
......
@REM Copyright (c) Facebook, Inc. and its affiliates.
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
@REM You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing, software
@REM distributed under the License is distributed on an "AS IS" BASIS,
@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@REM See the License for the specific language governing permissions and
@REM limitations under the License.
@echo off
SETLOCAL
if exist %~dp0\..\..\opensource\fbcode_builder\getdeps.py (
set GETDEPS=%~dp0\..\..\opensource\fbcode_builder\getdeps.py
) else if exist %~dp0\build\fbcode_builder\getdeps.py (
set GETDEPS=%~dp0\build\fbcode_builder\getdeps.py
) else (
echo "error: unable to find getdeps.py"
exit 1
)
python3.exe %GETDEPS% build folly %*
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This script is just a simple wrapper around the
# build/fbcode_builder/getdeps.py script.
#
# Feel free to invoke getdeps.py directly to have more control over the build.
SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
GETDEPS_PATHS=(
"$SCRIPT_DIR/build/fbcode_builder/getdeps.py"
"$SCRIPT_DIR/../../opensource/fbcode_builder/getdeps.py"
)
for getdeps in "${GETDEPS_PATHS[@]}"; do
if [[ -x "$getdeps" ]]; then
exec "$getdeps" build folly "$@"
fi
done
echo "Could not find getdeps.py" >&2
exit 1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment