|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +message("Getting dependencies for ABI compatability check...") |
| 19 | +# Get the latest version of abi-dumper and abi-compliance-checker |
| 20 | +include(FetchContent) |
| 21 | +FetchContent_Declare(abi-dumper |
| 22 | + GIT_REPOSITORY https://github.com/lvc/abi-dumper.git |
| 23 | + GIT_TAG 1.4 |
| 24 | +) |
| 25 | +FetchContent_GetProperties(abi-dumper) |
| 26 | +if(NOT abi-dumper_POPULATED) |
| 27 | + FetchContent_Populate(abi-dumper) |
| 28 | +endif() |
| 29 | + |
| 30 | +FetchContent_Declare(abi-compliance-checker |
| 31 | + GIT_REPOSITORY https://github.com/lvc/abi-compliance-checker.git |
| 32 | + GIT_TAG f60ce442c33f1d5cda1cec7cfddee24af1777572 |
| 33 | +) |
| 34 | +FetchContent_GetProperties(abi-compliance-checker) |
| 35 | +if(NOT abi-compliance-checker_POPULATED) |
| 36 | + FetchContent_Populate(abi-compliance-checker) |
| 37 | +endif() |
| 38 | + |
| 39 | +# The local script is patched to exclude register assignments to parameters |
| 40 | +#set(abi-dumper-script ${abi-dumper_SOURCE_DIR}/abi-dumper.pl) |
| 41 | +set(abi-dumper-script ${CMAKE_CURRENT_SOURCE_DIR}/abi-dumper.pl) |
| 42 | +set(abi-compliance-script ${abi-compliance-checker_SOURCE_DIR}/abi-compliance-checker.pl) |
| 43 | + |
| 44 | +add_custom_target(dump-abi ALL |
| 45 | + COMMAND perl ${abi-dumper-script} -public-headers public_header_files.txt -o new-abi.dump -skip-cxx -vnum ${log4cxx_VER} $<TARGET_FILE:log4cxx> |
| 46 | + DEPENDS log4cxx |
| 47 | + COMMENT "Dumping ABI symbols" |
| 48 | +) |
| 49 | + |
| 50 | +add_custom_target(compare-abi ALL |
| 51 | + COMMAND perl ${abi-compliance-script} -skip-internal-symbols "\\d\\(fmt\\)" -skip-internal-types "\\(fmt\\)::" -l log4cxx -old ${CMAKE_CURRENT_SOURCE_DIR}/abi.dump -new new-abi.dump |
| 52 | + DEPENDS dump-abi |
| 53 | + COMMENT "Comparing ABI symbols" |
| 54 | +) |
0 commit comments