mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-05 19:55:47 +03:00
Add support for extra_cmake_defines
Summary: `extra_cmake_defines` are extra flags that are passed to cmake when compiling each one of the dependencies. For instance: ``` $ ./opensource/fbcode_builder/getdeps.py build f4d --extra-cmake-define='{"CMAKE_CXX_FLAGS": "-mavx2 -mfma -mavx -mf16c -march=native"}' ``` It takes a json map as input, which can take a list of defines (key value pairs). Reviewed By: wez Differential Revision: D25855781 fbshipit-source-id: 7f4fef2c66f4d12f23c8d7086d6a4f24fcc01ff7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3f72d63896
commit
326b7f910e
@@ -7,6 +7,7 @@
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
@@ -500,6 +501,12 @@ class BuildCmd(ProjectCmdBase):
|
||||
if dep_build:
|
||||
sources_changed = True
|
||||
|
||||
extra_cmake_defines = (
|
||||
json.loads(args.extra_cmake_defines)
|
||||
if args.extra_cmake_defines
|
||||
else {}
|
||||
)
|
||||
|
||||
if sources_changed or reconfigure or not os.path.exists(built_marker):
|
||||
if os.path.exists(built_marker):
|
||||
os.unlink(built_marker)
|
||||
@@ -512,6 +519,7 @@ class BuildCmd(ProjectCmdBase):
|
||||
ctx,
|
||||
loader,
|
||||
final_install_prefix=loader.get_project_install_prefix(m),
|
||||
extra_cmake_defines=extra_cmake_defines,
|
||||
)
|
||||
builder.build(install_dirs, reconfigure=reconfigure)
|
||||
|
||||
@@ -639,6 +647,14 @@ class BuildCmd(ProjectCmdBase):
|
||||
parser.add_argument(
|
||||
"--schedule-type", help="Indicates how the build was activated"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--extra-cmake-defines",
|
||||
help=(
|
||||
"Input json map that contains extra cmake defines to be used "
|
||||
"when compiling the current project and all its deps. "
|
||||
'e.g: \'{"CMAKE_CXX_FLAGS": "--bla"}\''
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@cmd("fixup-dyn-deps", "Adjusts dynamic dependencies for packaging purposes")
|
||||
|
Reference in New Issue
Block a user