2019-04-06 03:47:17 +08:00
|
|
|
include(ExternalProject)
|
2017-08-09 04:15:04 +08:00
|
|
|
set(PBM_PREFIX protobuf_mutator)
|
|
|
|
set(PBM_PATH ${CMAKE_CURRENT_BINARY_DIR}/${PBM_PREFIX}/src/${PBM_PREFIX})
|
2017-11-01 04:49:57 +08:00
|
|
|
set(PBM_LIB_PATH ${PBM_PATH}-build/src/libprotobuf-mutator.a)
|
|
|
|
set(PBM_FUZZ_LIB_PATH ${PBM_PATH}-build/src/libfuzzer/libprotobuf-mutator-libfuzzer.a)
|
2017-08-09 04:15:04 +08:00
|
|
|
|
|
|
|
ExternalProject_Add(${PBM_PREFIX}
|
|
|
|
PREFIX ${PBM_PREFIX}
|
|
|
|
GIT_REPOSITORY https://github.com/google/libprotobuf-mutator.git
|
2017-10-19 02:38:04 +08:00
|
|
|
GIT_TAG master
|
2017-11-01 04:49:57 +08:00
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
|
|
|
CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
|
|
|
|
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
|
2017-08-09 04:15:04 +08:00
|
|
|
BUILD_BYPRODUCTS ${PBM_LIB_PATH} ${PBM_FUZZ_LIB_PATH}
|
2017-11-01 04:49:57 +08:00
|
|
|
UPDATE_COMMAND ""
|
2017-08-09 04:15:04 +08:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ProtobufMutator_INCLUDE_DIRS ${PBM_PATH})
|
|
|
|
set(ProtobufMutator_LIBRARIES ${PBM_FUZZ_LIB_PATH} ${PBM_LIB_PATH})
|