Added an external dependency on protobufs, included when SPIRV_BUILD_FUZZER is defined, so that they can be used by the (upcoming) spirv-fuzz tool. Also updated the kokoro build scripts, for relevant targets, to clone an appropriate tag of the protobufs repo, and to pass -DSPIRV_BUILD_FUZZER to the configurations for which we intend to ultimately build spirv-fuzz. (#2616)
This commit is contained in:
Родитель
4557d08584
Коммит
b0504239ab
|
@ -9,6 +9,7 @@ compile_commands.json
|
|||
/external/spirv-headers
|
||||
/external/effcee
|
||||
/external/re2
|
||||
/external/protobuf
|
||||
/out
|
||||
/TAGS
|
||||
/third_party/llvm-build/
|
||||
|
|
|
@ -102,3 +102,15 @@ if (NOT ${SPIRV_SKIP_TESTS})
|
|||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SPIRV_BUILD_FUZZER)
|
||||
set(PROTOBUF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/cmake)
|
||||
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Disable protobuf tests")
|
||||
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Do not build protobuf static runtime")
|
||||
if (IS_DIRECTORY ${PROTOBUF_DIR})
|
||||
add_subdirectory(${PROTOBUF_DIR} EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
"protobuf not found - please checkout a copy under external/.")
|
||||
endif()
|
||||
endif(SPIRV_BUILD_FUZZER)
|
||||
|
|
|
@ -71,13 +71,18 @@ git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv
|
|||
git clone --depth=1 https://github.com/google/googletest external/googletest
|
||||
git clone --depth=1 https://github.com/google/effcee external/effcee
|
||||
git clone --depth=1 https://github.com/google/re2 external/re2
|
||||
git clone --depth=1 https://github.com/protocolbuffers/protobuf external/protobuf
|
||||
pushd external/protobuf
|
||||
git fetch --all --tags --prune
|
||||
git checkout v3.7.1
|
||||
popd
|
||||
|
||||
mkdir build && cd $SRC/build
|
||||
|
||||
# Invoke the build.
|
||||
BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT}
|
||||
echo $(date): Starting build...
|
||||
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -GNinja -DCMAKE_INSTALL_PREFIX=$KOKORO_ARTIFACTS_DIR/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DRE2_BUILD_TESTING=OFF $ADDITIONAL_CMAKE_FLAGS $CMAKE_C_CXX_COMPILER ..
|
||||
cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -GNinja -DCMAKE_INSTALL_PREFIX=$KOKORO_ARTIFACTS_DIR/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DRE2_BUILD_TESTING=OFF -DSPIRV_BUILD_FUZZER=ON $ADDITIONAL_CMAKE_FLAGS $CMAKE_C_CXX_COMPILER ..
|
||||
|
||||
echo $(date): Build everything...
|
||||
ninja
|
||||
|
|
|
@ -35,6 +35,11 @@ git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv
|
|||
git clone --depth=1 https://github.com/google/googletest external/googletest
|
||||
git clone --depth=1 https://github.com/google/effcee external/effcee
|
||||
git clone --depth=1 https://github.com/google/re2 external/re2
|
||||
git clone --depth=1 https://github.com/protocolbuffers/protobuf external/protobuf
|
||||
pushd external/protobuf
|
||||
git fetch --all --tags --prune
|
||||
git checkout v3.7.1
|
||||
popd
|
||||
|
||||
mkdir build && cd $SRC/build
|
||||
|
||||
|
@ -49,6 +54,7 @@ cmake \
|
|||
-DCMAKE_C_COMPILER=clang \
|
||||
-DCMAKE_CXX_COMPILER=clang++ \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DSPIRV_BUILD_FUZZER=ON \
|
||||
..
|
||||
|
||||
echo $(date): Build everything...
|
||||
|
|
|
@ -29,6 +29,11 @@ git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv
|
|||
git clone --depth=1 https://github.com/google/googletest external/googletest
|
||||
git clone --depth=1 https://github.com/google/effcee external/effcee
|
||||
git clone --depth=1 https://github.com/google/re2 external/re2
|
||||
git clone --depth=1 https://github.com/protocolbuffers/protobuf external/protobuf
|
||||
pushd external\protobuf
|
||||
git fetch --all --tags --prune
|
||||
git checkout v3.7.1
|
||||
popd
|
||||
|
||||
:: #########################################
|
||||
:: set up msvc build env
|
||||
|
@ -65,6 +70,11 @@ if %VS_VERSION% == 2013 (
|
|||
set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_SKIP_TESTS=ON
|
||||
)
|
||||
|
||||
:: Skip building spirv-fuzz for VS2013; it relies on protobufs which VS2013 cannot handle.
|
||||
if %VS_VERSION% NEQ 2013 (
|
||||
set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_BUILD_FUZZER=ON
|
||||
)
|
||||
|
||||
cmake %CMAKE_FLAGS% ..
|
||||
|
||||
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
|
||||
|
|
Загрузка…
Ссылка в новой задаче