mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
CMake: Do not generate .isystem files for libtooling interface generator
The generated `compile_commands.json` contains everything that the interface generator needs. PiperOrigin-RevId: 439800377 Change-Id: I5b364edc20eaae9554ce10a96caa3559fb780210
This commit is contained in:
parent
c5afd39cc4
commit
eb20966666
|
@ -145,7 +145,6 @@ function(add_sapi_library)
|
||||||
set(_sapi_embed_name "${_sapi_NAME}")
|
set(_sapi_embed_name "${_sapi_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(_sapi_isystem "${_sapi_NAME}.isystem")
|
|
||||||
list(APPEND _sapi_generator_args
|
list(APPEND _sapi_generator_args
|
||||||
"--sapi_name=${_sapi_LIBRARY_NAME}"
|
"--sapi_name=${_sapi_LIBRARY_NAME}"
|
||||||
"--sapi_out=${_sapi_gen_header}"
|
"--sapi_out=${_sapi_gen_header}"
|
||||||
|
@ -153,7 +152,6 @@ function(add_sapi_library)
|
||||||
"--sapi_embed_name=${_sapi_embed_name}"
|
"--sapi_embed_name=${_sapi_embed_name}"
|
||||||
"--sapi_functions=${_sapi_funcs}"
|
"--sapi_functions=${_sapi_funcs}"
|
||||||
"--sapi_ns=${_sapi_NAMESPACE}"
|
"--sapi_ns=${_sapi_NAMESPACE}"
|
||||||
"--sapi_isystem=${_sapi_isystem}"
|
|
||||||
)
|
)
|
||||||
if(SAPI_ENABLE_GENERATOR)
|
if(SAPI_ENABLE_GENERATOR)
|
||||||
list(APPEND _sapi_generator_command
|
list(APPEND _sapi_generator_command
|
||||||
|
@ -162,26 +160,35 @@ function(add_sapi_library)
|
||||||
${_sapi_generator_args}
|
${_sapi_generator_args}
|
||||||
${_sapi_full_inputs}
|
${_sapi_full_inputs}
|
||||||
)
|
)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_sapi_gen_header}"
|
||||||
|
COMMAND ${_sapi_generator_command}
|
||||||
|
COMMENT "Generating interface"
|
||||||
|
DEPENDS ${_sapi_INPUTS}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
|
set(_sapi_isystem "${_sapi_NAME}.isystem")
|
||||||
list(JOIN _sapi_full_inputs "," _sapi_full_inputs)
|
list(JOIN _sapi_full_inputs "," _sapi_full_inputs)
|
||||||
list(APPEND _sapi_generator_command
|
list(APPEND _sapi_generator_command
|
||||||
"${SAPI_PYTHON3_EXECUTABLE}" -B
|
"${SAPI_PYTHON3_EXECUTABLE}" -B
|
||||||
"${SAPI_SOURCE_DIR}/sandboxed_api/tools/generator2/sapi_generator.py"
|
"${SAPI_SOURCE_DIR}/sandboxed_api/tools/generator2/sapi_generator.py"
|
||||||
${_sapi_generator_args}
|
${_sapi_generator_args}
|
||||||
|
"--sapi_isystem=${_sapi_isystem}"
|
||||||
"--sapi_in=${_sapi_full_inputs}"
|
"--sapi_in=${_sapi_full_inputs}"
|
||||||
)
|
)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${_sapi_gen_header}" "${_sapi_isystem}"
|
||||||
|
COMMAND sh -c
|
||||||
|
"${CMAKE_CXX_COMPILER} -E -x c++ -v /dev/null 2>&1 | \
|
||||||
|
awk '/> search starts here:/{f=1;next}/^End of search/{f=0}f{print $1}' \
|
||||||
|
> \"${_sapi_isystem}\""
|
||||||
|
COMMAND ${_sapi_generator_command}
|
||||||
|
COMMENT "Generating interface"
|
||||||
|
DEPENDS ${_sapi_INPUTS}
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${_sapi_gen_header}" "${_sapi_isystem}"
|
|
||||||
COMMAND sh -c
|
|
||||||
"${CMAKE_CXX_COMPILER} -E -x c++ -v /dev/null 2>&1 | \
|
|
||||||
awk '/> search starts here:/{f=1;next}/^End of search/{f=0}f{print $1}' \
|
|
||||||
> \"${_sapi_isystem}\""
|
|
||||||
COMMAND ${_sapi_generator_command}
|
|
||||||
COMMENT "Generating interface"
|
|
||||||
DEPENDS ${_sapi_INPUTS}
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
|
|
||||||
# Library with the interface
|
# Library with the interface
|
||||||
if(NOT _sapi_SOURCES)
|
if(NOT _sapi_SOURCES)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user