Skip to content

Commit 248fb86

Browse files
authored
Merge pull request #137 from haberman/updatetp
Updated third_party submodules.
2 parents 0c9ef08 + f114b59 commit 248fb86

11 files changed

+80
-32
lines changed

Diff for: CMakeLists.txt

+30-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
cmake_minimum_required (VERSION 2.6)
2-
project (Bloaty)
1+
cmake_minimum_required (VERSION 3.0)
2+
cmake_policy(SET CMP0048 NEW)
3+
project (Bloaty VERSION 1.0)
34

45
# Options we define for users.
56
option(BLOATY_ENABLE_ASAN "Enable address sanitizer." OFF)
@@ -94,6 +95,9 @@ add_library(libbloaty
9495
third_party/abseil-cpp/absl/base/internal/raw_logging.cc # Grrrr...
9596
third_party/abseil-cpp/absl/base/internal/throw_delegate.cc
9697
third_party/abseil-cpp/absl/strings/ascii.cc
98+
third_party/abseil-cpp/absl/strings/charconv.cc
99+
third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc
100+
third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc
97101
third_party/abseil-cpp/absl/strings/escaping.cc
98102
third_party/abseil-cpp/absl/strings/internal/memutil.cc
99103
third_party/abseil-cpp/absl/strings/internal/utf8.cc
@@ -136,34 +140,36 @@ else()
136140
RUNTIME DESTINATION bin
137141
)
138142

139-
enable_testing()
143+
if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/tests")
144+
enable_testing()
140145

141-
if(BUILD_TESTING)
142-
add_subdirectory(third_party/googletest)
143-
include_directories(third_party/googletest/googletest/include)
144-
include_directories(third_party/googletest/googlemock/include)
146+
if(BUILD_TESTING)
147+
add_subdirectory(third_party/googletest)
148+
include_directories(third_party/googletest/googletest/include)
149+
include_directories(third_party/googletest/googlemock/include)
145150

146-
set(TEST_TARGETS
147-
bloaty_test
148-
bloaty_misc_test
149-
range_map_test
150-
)
151+
set(TEST_TARGETS
152+
bloaty_test
153+
bloaty_misc_test
154+
range_map_test
155+
)
151156

152-
foreach(target ${TEST_TARGETS})
153-
add_executable(${target} tests/${target}.cc)
154-
target_link_libraries(${target} "${LIBBLOATY_LIBS}" gtest_main gmock "${CMAKE_THREAD_LIBS_INIT}")
155-
endforeach(target)
157+
foreach(target ${TEST_TARGETS})
158+
add_executable(${target} tests/${target}.cc)
159+
target_link_libraries(${target} "${LIBBLOATY_LIBS}" gtest_main gmock "${CMAKE_THREAD_LIBS_INIT}")
160+
endforeach(target)
156161

157-
add_executable(fuzz_test tests/fuzz_target.cc tests/fuzz_driver.cc)
158-
target_link_libraries(fuzz_test "${LIBBLOATY_LIBS}" "${CMAKE_THREAD_LIBS_INIT}")
162+
add_executable(fuzz_test tests/fuzz_target.cc tests/fuzz_driver.cc)
163+
target_link_libraries(fuzz_test "${LIBBLOATY_LIBS}" "${CMAKE_THREAD_LIBS_INIT}")
159164

160-
file(GLOB fuzz_corpus tests/testdata/fuzz_corpus/*)
165+
file(GLOB fuzz_corpus tests/testdata/fuzz_corpus/*)
161166

162-
add_test(NAME range_map_test COMMAND range_map_test)
163-
add_test(NAME bloaty_test_x86-64 COMMAND bloaty_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/linux-x86_64)
164-
add_test(NAME bloaty_test_x86 COMMAND bloaty_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/linux-x86)
165-
add_test(NAME bloaty_misc_test COMMAND bloaty_misc_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/misc)
166-
add_test(NAME fuzz_test COMMAND fuzz_test ${fuzz_corpus} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/fuzz_corpus)
167+
add_test(NAME range_map_test COMMAND range_map_test)
168+
add_test(NAME bloaty_test_x86-64 COMMAND bloaty_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/linux-x86_64)
169+
add_test(NAME bloaty_test_x86 COMMAND bloaty_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/linux-x86)
170+
add_test(NAME bloaty_misc_test COMMAND bloaty_misc_test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/misc)
171+
add_test(NAME fuzz_test COMMAND fuzz_test ${fuzz_corpus} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata/fuzz_corpus)
172+
endif()
167173
endif()
168174

169175
install(EXPORT ${PROJECT_NAME}Targets NAMESPACE ${PROJECT_NAME} DESTINATION lib/${PROJECT_NAME})

Diff for: make-release-tarball.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
# Makes a release tarball. We include our dependencies/submodules,
4+
# but we heavily prune their file lists to avoid including lots of
5+
# extraneous baggage. We also leave out Bloaty's tests, especially
6+
# because some of the test data is large.
7+
8+
set -e
9+
10+
if [ "$#" -ne 1 ]; then
11+
echo "Usage: make-release.tarball.sh VERSION"
12+
exit 1
13+
fi
14+
15+
VERSION=$1
16+
17+
FILES=$(git ls-files --exclude-standard --recurse-submodules |
18+
grep -v googletest |
19+
grep -v ^tests |
20+
grep -v third_party/protobuf |
21+
grep -v 'third_party/capstone/\(suite\|bindings\|xcode\|msvc\|contrib\)' |
22+
grep -v ^.git)
23+
FILES="$FILES $(git ls-files --exclude-standard --recurse-submodules |
24+
grep 'third_party/protobuf/\(src\|cmake\|configure.ac\)')"
25+
26+
# Unfortunately tar on Mac doesn't support --transform, so we have to
27+
# actually move our files to a different directory to get the prefix.
28+
DIR=/tmp/bloaty-$VERSION
29+
rm -rf $DIR
30+
mkdir $DIR
31+
rsync -R $FILES $DIR
32+
33+
BASE=$PWD
34+
cd /tmp
35+
OUT=bloaty-$VERSION.tar.bz2
36+
tar cjf $BASE/$OUT bloaty-$VERSION
37+
38+
echo "Created $OUT"
39+

Diff for: src/bloaty.cc

+3
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,9 @@ bool DoParseOptions(bool skip_unknown, int* argc, char** argv[],
18841884
} else if (args.TryParseFlag("--help")) {
18851885
fputs(usage, stderr);
18861886
return false;
1887+
} else if (args.TryParseFlag("--version")) {
1888+
printf("Bloaty McBloatface 1.0\n");
1889+
exit(0);
18871890
} else if (absl::StartsWith(args.Arg(), "-")) {
18881891
if (skip_unknown) {
18891892
args.ConsumeAndSaveArg();

Diff for: src/bloaty.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#include "absl/strings/string_view.h"
3434
#include "absl/strings/strip.h"
35-
#include "capstone.h"
35+
#include "capstone/capstone.h"
3636
#include "re2/re2.h"
3737

3838
#include "bloaty.pb.h"

Diff for: src/disassemble.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "absl/strings/str_cat.h"
2121
#include "absl/strings/string_view.h"
2222
#include "absl/strings/substitute.h"
23-
#include "capstone.h"
23+
#include "capstone/capstone.h"
2424

2525
static void Throw(const char *str, int line) {
2626
throw bloaty::Error(str, __FILE__, line);

Diff for: third_party/abseil-cpp

Submodule abseil-cpp updated 913 files

Diff for: third_party/capstone

Diff for: third_party/demumble

Submodule demumble updated 1 file

Diff for: third_party/googletest

Submodule googletest updated 216 files

Diff for: third_party/protobuf

0 commit comments

Comments
 (0)