Summary:
On Windows, compile a small C executable to prepend to the zip file, to allow
the resulting executable files to be run directly on Windows, without needing
to explicitly invoke the Python interpreter to run the output file.
Reviewed By: wez
Differential Revision: D17733616
fbshipit-source-id: 989a93851412d0bbe1e7857aa9111db082f67a4c
Summary:
Add a function for defining Python unit tests. This creates the test
executable, and also emits logic to perform test discovery for ctest.
Reviewed By: simpkins
Differential Revision: D17610034
fbshipit-source-id: cdf15b0b04acc1d3e906a1e2a95eb327951176ba
Summary:
Export a property that indicates the path to the test executable. This is
useful for callers that want to install the binary or run it from other CMake
rules.
Reviewed By: simpkins
Differential Revision: D17647146
fbshipit-source-id: b32e2694e44a07d7c234e53a7a5c8443cb144487
Summary:
Update the code to use `os.replace()` rather than `os.rename()` so that it
won't fail on Windows if the destination path already exists.
Reviewed By: chadaustin
Differential Revision: D17462716
fbshipit-source-id: cbc06319ccb2d73868f80ab1874890ebec5a621b
Summary:
Update the thrift C++ and Python CMake rules to indicate that the output also
depends on the thrift compiler itself.
Previously the C++ rule indicated that the output depended on the thrift
template files, which caught most cases when the thrift compiler was updated,
but wasn't fully correct. The thrift templates were also removed and baked
into the thrift compiler binary in D16356056.
Reviewed By: yfeldblum, chadaustin
Differential Revision: D17401217
fbshipit-source-id: ae5cde7a7e5e07a74406a1b6f4469124187bc12f
Summary:
Add a license header to satisfy the open source linter. Use the same
header the other .cmake files have.
Reviewed By: mhlakhani
Differential Revision: D17404782
fbshipit-source-id: 66679d72c9e680f8bb8b27869e981a046b3520cf
Summary:
We would like to build a version of proxygen that has minimal
dependencies on dynamic libraries.
Reviewed By: yfeldblum
Differential Revision: D17228181
fbshipit-source-id: cfd61afdfa978c49a536184f426502196241fb8a
Summary:
On Windows we have to explicitly invoke `make_fbpy_archive.py` with python.
Therefore use CMake's built-in `FindPythonInterp` module to find the python
executable and use that when invoking `make_fbpy_archive.py`
This is slightly complicated by the effort required to find python with older
versions of CMake. We ideally still want to support versions of CMake back to
at least 3.8, which means we need to still support finding Python with the
older `FindPythonInterp.cmake` module
Reviewed By: wez
Differential Revision: D17128606
fbshipit-source-id: 3f4beff76848b8a362ebdf21198e7a8bf1b0537f
Summary: [Thrift] Bake templates into the compiler binary rather than having to package the templates with the compiler.
Reviewed By: stevegury, vitaut
Differential Revision: D16356056
fbshipit-source-id: b971dce7aada8dc2a26587fbf818e661acd0c555
Summary:
* Fix a minor issue with `add_fb_python_executable` where it would
emit `--main` even if `MAIN_MODULE` had not been specified
* Introduce the ability to rename python sources in the manifest so
that they have a different install path.
* Note that this changes the DEPENDS parameters to reference abs_sources;
previously these were using relative paths to the sources pulled directly
from the SOURCES arguments, but since those can now contain aliasing
operations we need to pre-process the list. I switched to abs_sources
because that was already being maintained. If for some reason the
DEPENDS list needs to be relative paths, this will need to be adjusted.
Reviewed By: simpkins
Differential Revision: D17147417
fbshipit-source-id: d0825bfbdad6be658c078aaac6645e6926a1530f
Summary: when trying to build openr with `getDeps.py` constant definitions where not available since they were not part of the generated thrift lib. this fixes it.
Reviewed By: chadaustin
Differential Revision: D16064417
fbshipit-source-id: ee2b3e061caf67235f4a873405cf6cd6fb663ef4
Summary:
This module provides a `add_fbthrift_library()` convenience function that can
be used to generate thrift libraries for multiple languages with a single
call.
Reviewed By: wez
Differential Revision: D16742275
fbshipit-source-id: c13120cf9e051629951282141eb22f3e085782f9
Summary:
This module helps generate Python libraries from thrift files.
It is the Python equivalent of `FBThriftCppLibrary.cmake`
Reviewed By: wez
Differential Revision: D16742274
fbshipit-source-id: ef0dc7f24eb1c7375d2587ee6b71fd25bd6f35a7
Summary:
Fix a minor bug in the argument parsing for `add_fbthrift_cpp_library()`:
only a single value should be supplied for the `THRIFT_INCLUDE_DIR` argument.
This parameter should not accept a list of arguments.
Reviewed By: strager
Differential Revision: D17125810
fbshipit-source-id: 31f354e4d6299d3626a94f3b4b5ff8c58bb0cf7b
Summary:
Rename the `ThriftCppLibrary.cmake` file to `FBThriftCppLibrary.cmake`, and
also rename `add_thrift_cpp2_library()` to `add_fbthrift_cpp_library()`.
Explicitly calling this `fbthrift` helps clearly distinguish that this is
intended for use with fbthrift (https://github.com/facebook/fbthrift/), as
opposed to Apache thrift.
Reviewed By: wez
Differential Revision: D16738440
fbshipit-source-id: 9b255e06b71c98ad74a34989f564a211958dcdd5
Summary:
Update install_fb_python_library() to work with CMake versions older than 3.7.
Previously the code used a generator expression in the directory argument
supplied to `install(DIRECTORY)`. Support for generators in this parameter
was only added in CMake 3.5, but it was buggy and did not correctly handle
absolute paths until 3.7.
This updates the code to avoid using a generator expression. This does
require that the corresponding `add_fb_python_library()` statement appear
before the `install_fb_python_library()` statement, but this seems like a
pretty reasonable restriction.
Reviewed By: chadaustin
Differential Revision: D17103597
fbshipit-source-id: 54d6af93a3f530373cfe3137db99436d8484f308
Summary:
This just strips off a trailing '/' from the `INSTALL_DIR` property that we
set on python targets, to avoid having double-slashes in the paths that we use
during installation. This shouldn't really have any material difference other
than cleaning up the paths that get printed during the installation phase.
Reviewed By: chadaustin
Differential Revision: D17089207
fbshipit-source-id: ab36bb76c19fa60fe037f7a5290ccfd6bdbf13b0
Summary:
Update fboss to use `ThriftCppLibrary.cmake` directly from fbcode_builder
rather than maintaining its own copy of this file.
Reviewed By: chadaustin
Differential Revision: D17005421
fbshipit-source-id: a64df426118df6088b47f09410dad7b8b7e79a43
Summary:
Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when
invoking the thrift compiler so that it can find all of the other thrift files
that this library depends on.
D16062657 was a previous attempt to do this, but suffered from a few problems:
- It required all dependencies to be defined before
`add_thrift_cpp2_library()` was called. This requires users to carefully
order their CMake files and subdirectory include ordering.
- It only handled one level of dependencies, and did not propagate include
paths for deeper dependencies.
- It set the include path for dependencies to the source directory path where
the dependency was originally built, rather than the directory where the
thrift file for that dependency would be installed.
This change does require CMake 3.8+. Previous versions of CMake do not
support using generator expressions to generate multiple arguments for a
custom command.
Reviewed By: strager
Differential Revision: D17005381
fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d
Summary:
Update add_thrift_cpp2_library() to add a PUBLIC_HEADER property to the
generated library target, so that the generated headers can be installed using
an `install()` call. Also add a `HEADER_INSTALL_DIR` property which indicates
the directory they should be installed into. A `INCLUDE_DIR` argument was
added to customize the include installation path, should anyone care to do so.
This also removes code that was previously incorrectly installing the
generated headers into the source tree.
Reviewed By: wez
Differential Revision: D16853404
fbshipit-source-id: 6f640b2bd347c99804e074fca0209dda37c8a9cf
Summary:
Update ThriftCppLibrary.cmake to record that the output depends on the thrift
`cpp2` template files. The `THRIFT_TEMPLATE_FILES` variable was defined in
D16062657 but doesn't appear to be used anywhere. This uses it, and also
updates it to only match the C++ template files.
Reviewed By: wez
Differential Revision: D16738442
fbshipit-source-id: aa4097e9ec1d009ef1e3ee2efd03ffa19a82ed12
Summary:
Add explicit double quotes around arguments that are intended to be exactly a
single parameter. Also line wrap to 80 characters.
Reviewed By: wez
Differential Revision: D16738443
fbshipit-source-id: b8c9b6d50da72b44e23eaf5effbc384b6cbbc1c0
Summary:
Change ThriftCppLibrary to use `fb_cmake_parse_args()`
This code doesn't really care much about handling empty arguments, so we could
use the standard `cmake_parse_arguments()` function here instead of
`fb_cmake_parse_args()`. However, it is slightly more convenient that
`fb_cmake_parse_args()` automatically errors out on unhandled arguments, so
that we don't have to check for this ourselves.
Reviewed By: wez
Differential Revision: D16738445
fbshipit-source-id: 67b9761f2ceaf7665bd336290bb44af32fec6f4a
Summary:
Add some CMake functions for building standalone executables from Python
source files. This generates executables similar to PEX
(https://github.com/pantsbuild/pex).
In the future this could potentially be leveraged to directly build XAR files
(https://github.com/facebookincubator/xar).
The main advantages of these functions is that they allow easily defining
"libraries" of python files, and their dependencies, which can then be used
and packaged as part of multiple different standalone executables.
Reviewed By: wez
Differential Revision: D16722499
fbshipit-source-id: e1d829b911dc428e5438b5cf9cebf99b3fb6ce24
Summary: eden.thrift includes fb303_core.thrift, so any cmake target that depends on eden.thrift should pull in fb303_core.thrift's include directories and libraries. Implement that machinery in CppThriftLibrary.cmake.
Reviewed By: wez
Differential Revision: D16062657
fbshipit-source-id: d5d962960e767a138a9b634a12aebccf72d6ef43
Summary:
Fix an error about source directories being included in the include
path in add_thrift_cpp2_library. I don't know why this was failing for
fb303 and not for other projects, but adding a generation expression
appears to fix the issue.
Reviewed By: strager
Differential Revision: D15725024
fbshipit-source-id: 6c02fed6c6703733cf9e0b130c0f90b70e3ea300
Summary:
Initial commit to include the fbcode_builder sources in the
eden github repository.
fbshipit-source-id: 49098cecda04a7e9dd9dcc0b569fffc96f0f719b