From 6dab72a9f8198d8a9b46007c473b20b6a726b8c4 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Fri, 12 Jan 2024 22:52:39 +0000 Subject: [PATCH] Separate demangler source files from headers, add additional build flag --- thirdparty/demanglegnu/CMakeLists.txt | 37 ++++++++++--------- .../demanglegnu/{ => include}/ansidecl.h | 0 .../demanglegnu/{ => include}/cp-demangle.h | 0 .../demanglegnu/{ => include}/demangle.h | 0 .../demanglegnu/{ => include}/dyn-string.h | 0 .../demanglegnu/{ => include}/environ.h | 0 thirdparty/demanglegnu/{ => include}/getopt.h | 0 .../demanglegnu/{ => include}/libiberty.h | 0 .../demanglegnu/{ => include}/safe-ctype.h | 0 thirdparty/demanglegnu/{ => src}/alloca.c | 0 thirdparty/demanglegnu/{ => src}/argv.c | 0 .../demanglegnu/{ => src}/cp-demangle.c | 0 thirdparty/demanglegnu/{ => src}/cplus-dem.c | 0 thirdparty/demanglegnu/{ => src}/d-demangle.c | 0 thirdparty/demanglegnu/{ => src}/dyn-string.c | 0 thirdparty/demanglegnu/{ => src}/getopt.c | 0 thirdparty/demanglegnu/{ => src}/getopt1.c | 0 .../demanglegnu/{ => src}/rust-demangle.c | 0 thirdparty/demanglegnu/{ => src}/safe-ctype.c | 0 thirdparty/demanglegnu/{ => src}/xexit.c | 0 thirdparty/demanglegnu/{ => src}/xmalloc.c | 0 thirdparty/demanglegnu/{ => src}/xmemdup.c | 0 thirdparty/demanglegnu/{ => src}/xstrdup.c | 0 23 files changed, 20 insertions(+), 17 deletions(-) rename thirdparty/demanglegnu/{ => include}/ansidecl.h (100%) rename thirdparty/demanglegnu/{ => include}/cp-demangle.h (100%) rename thirdparty/demanglegnu/{ => include}/demangle.h (100%) rename thirdparty/demanglegnu/{ => include}/dyn-string.h (100%) rename thirdparty/demanglegnu/{ => include}/environ.h (100%) rename thirdparty/demanglegnu/{ => include}/getopt.h (100%) rename thirdparty/demanglegnu/{ => include}/libiberty.h (100%) rename thirdparty/demanglegnu/{ => include}/safe-ctype.h (100%) rename thirdparty/demanglegnu/{ => src}/alloca.c (100%) rename thirdparty/demanglegnu/{ => src}/argv.c (100%) rename thirdparty/demanglegnu/{ => src}/cp-demangle.c (100%) rename thirdparty/demanglegnu/{ => src}/cplus-dem.c (100%) rename thirdparty/demanglegnu/{ => src}/d-demangle.c (100%) rename thirdparty/demanglegnu/{ => src}/dyn-string.c (100%) rename thirdparty/demanglegnu/{ => src}/getopt.c (100%) rename thirdparty/demanglegnu/{ => src}/getopt1.c (100%) rename thirdparty/demanglegnu/{ => src}/rust-demangle.c (100%) rename thirdparty/demanglegnu/{ => src}/safe-ctype.c (100%) rename thirdparty/demanglegnu/{ => src}/xexit.c (100%) rename thirdparty/demanglegnu/{ => src}/xmalloc.c (100%) rename thirdparty/demanglegnu/{ => src}/xmemdup.c (100%) rename thirdparty/demanglegnu/{ => src}/xstrdup.c (100%) diff --git a/thirdparty/demanglegnu/CMakeLists.txt b/thirdparty/demanglegnu/CMakeLists.txt index c1990422..d610dd3d 100644 --- a/thirdparty/demanglegnu/CMakeLists.txt +++ b/thirdparty/demanglegnu/CMakeLists.txt @@ -1,24 +1,27 @@ add_library(demanglegnu STATIC - alloca.c - cp-demangle.c - cplus-dem.c - d-demangle.c - dyn-string.c - getopt1.c - getopt.c - rust-demangle.c - safe-ctype.c - xexit.c - xmalloc.c - xmemdup.c - xstrdup.c + src/alloca.c + src/cp-demangle.c + src/cplus-dem.c + src/d-demangle.c + src/dyn-string.c + src/getopt1.c + src/getopt.c + src/rust-demangle.c + src/safe-ctype.c + src/xexit.c + src/xmalloc.c + src/xmemdup.c + src/xstrdup.c ) -target_include_directories(demanglegnu PUBLIC .) -target_compile_definitions(demanglegnu PRIVATE -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1) + +set(GNU_DEMANGLER_FLAGS -DHAVE_DECL_BASENAME=1 -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1) + +target_include_directories(demanglegnu PUBLIC include) +target_compile_definitions(demanglegnu PUBLIC ${GNU_DEMANGLER_FLAGS}) add_executable(demangler_fuzzer testsuite/demangler-fuzzer.c) add_executable(demangler_test testsuite/test-demangle.c) target_link_libraries(demangler_fuzzer demanglegnu) target_link_libraries(demangler_test demanglegnu) -target_compile_definitions(demangler_fuzzer PRIVATE -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1) -target_compile_definitions(demangler_test PRIVATE -DHAVE_LIMITS_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1) +target_compile_definitions(demangler_fuzzer PUBLIC ${GNU_DEMANGLER_FLAGS}) +target_compile_definitions(demangler_test PUBLIC ${GNU_DEMANGLER_FLAGS}) diff --git a/thirdparty/demanglegnu/ansidecl.h b/thirdparty/demanglegnu/include/ansidecl.h similarity index 100% rename from thirdparty/demanglegnu/ansidecl.h rename to thirdparty/demanglegnu/include/ansidecl.h diff --git a/thirdparty/demanglegnu/cp-demangle.h b/thirdparty/demanglegnu/include/cp-demangle.h similarity index 100% rename from thirdparty/demanglegnu/cp-demangle.h rename to thirdparty/demanglegnu/include/cp-demangle.h diff --git a/thirdparty/demanglegnu/demangle.h b/thirdparty/demanglegnu/include/demangle.h similarity index 100% rename from thirdparty/demanglegnu/demangle.h rename to thirdparty/demanglegnu/include/demangle.h diff --git a/thirdparty/demanglegnu/dyn-string.h b/thirdparty/demanglegnu/include/dyn-string.h similarity index 100% rename from thirdparty/demanglegnu/dyn-string.h rename to thirdparty/demanglegnu/include/dyn-string.h diff --git a/thirdparty/demanglegnu/environ.h b/thirdparty/demanglegnu/include/environ.h similarity index 100% rename from thirdparty/demanglegnu/environ.h rename to thirdparty/demanglegnu/include/environ.h diff --git a/thirdparty/demanglegnu/getopt.h b/thirdparty/demanglegnu/include/getopt.h similarity index 100% rename from thirdparty/demanglegnu/getopt.h rename to thirdparty/demanglegnu/include/getopt.h diff --git a/thirdparty/demanglegnu/libiberty.h b/thirdparty/demanglegnu/include/libiberty.h similarity index 100% rename from thirdparty/demanglegnu/libiberty.h rename to thirdparty/demanglegnu/include/libiberty.h diff --git a/thirdparty/demanglegnu/safe-ctype.h b/thirdparty/demanglegnu/include/safe-ctype.h similarity index 100% rename from thirdparty/demanglegnu/safe-ctype.h rename to thirdparty/demanglegnu/include/safe-ctype.h diff --git a/thirdparty/demanglegnu/alloca.c b/thirdparty/demanglegnu/src/alloca.c similarity index 100% rename from thirdparty/demanglegnu/alloca.c rename to thirdparty/demanglegnu/src/alloca.c diff --git a/thirdparty/demanglegnu/argv.c b/thirdparty/demanglegnu/src/argv.c similarity index 100% rename from thirdparty/demanglegnu/argv.c rename to thirdparty/demanglegnu/src/argv.c diff --git a/thirdparty/demanglegnu/cp-demangle.c b/thirdparty/demanglegnu/src/cp-demangle.c similarity index 100% rename from thirdparty/demanglegnu/cp-demangle.c rename to thirdparty/demanglegnu/src/cp-demangle.c diff --git a/thirdparty/demanglegnu/cplus-dem.c b/thirdparty/demanglegnu/src/cplus-dem.c similarity index 100% rename from thirdparty/demanglegnu/cplus-dem.c rename to thirdparty/demanglegnu/src/cplus-dem.c diff --git a/thirdparty/demanglegnu/d-demangle.c b/thirdparty/demanglegnu/src/d-demangle.c similarity index 100% rename from thirdparty/demanglegnu/d-demangle.c rename to thirdparty/demanglegnu/src/d-demangle.c diff --git a/thirdparty/demanglegnu/dyn-string.c b/thirdparty/demanglegnu/src/dyn-string.c similarity index 100% rename from thirdparty/demanglegnu/dyn-string.c rename to thirdparty/demanglegnu/src/dyn-string.c diff --git a/thirdparty/demanglegnu/getopt.c b/thirdparty/demanglegnu/src/getopt.c similarity index 100% rename from thirdparty/demanglegnu/getopt.c rename to thirdparty/demanglegnu/src/getopt.c diff --git a/thirdparty/demanglegnu/getopt1.c b/thirdparty/demanglegnu/src/getopt1.c similarity index 100% rename from thirdparty/demanglegnu/getopt1.c rename to thirdparty/demanglegnu/src/getopt1.c diff --git a/thirdparty/demanglegnu/rust-demangle.c b/thirdparty/demanglegnu/src/rust-demangle.c similarity index 100% rename from thirdparty/demanglegnu/rust-demangle.c rename to thirdparty/demanglegnu/src/rust-demangle.c diff --git a/thirdparty/demanglegnu/safe-ctype.c b/thirdparty/demanglegnu/src/safe-ctype.c similarity index 100% rename from thirdparty/demanglegnu/safe-ctype.c rename to thirdparty/demanglegnu/src/safe-ctype.c diff --git a/thirdparty/demanglegnu/xexit.c b/thirdparty/demanglegnu/src/xexit.c similarity index 100% rename from thirdparty/demanglegnu/xexit.c rename to thirdparty/demanglegnu/src/xexit.c diff --git a/thirdparty/demanglegnu/xmalloc.c b/thirdparty/demanglegnu/src/xmalloc.c similarity index 100% rename from thirdparty/demanglegnu/xmalloc.c rename to thirdparty/demanglegnu/src/xmalloc.c diff --git a/thirdparty/demanglegnu/xmemdup.c b/thirdparty/demanglegnu/src/xmemdup.c similarity index 100% rename from thirdparty/demanglegnu/xmemdup.c rename to thirdparty/demanglegnu/src/xmemdup.c diff --git a/thirdparty/demanglegnu/xstrdup.c b/thirdparty/demanglegnu/src/xstrdup.c similarity index 100% rename from thirdparty/demanglegnu/xstrdup.c rename to thirdparty/demanglegnu/src/xstrdup.c