Commit dffd542b authored by Feng Xiao's avatar Feng Xiao

Update ./update_file_lists.sh.

Make it executable and generate extract_includes.bat in the same directory.
parent e9839ff4
......@@ -47,6 +47,11 @@ include(find_hash_map.cmake)
configure_file(config.h.in config.h)
configure_file(pbconfig.h.in google/protobuf/stubs/pbconfig.h)
if (MSVC)
string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR})
string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR})
configure_file(extract_includes.bat.in extract_includes.bat)
endif (MSVC)
get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH)
......
This diff is collapsed.
......@@ -39,8 +39,8 @@ set_variable_value() {
/^set\\($VARNAME/ {
start = 1;
print \$0;
split(values, vlist, \" \");
for (i = 1; i <= length(vlist); ++i) {
len = split(values, vlist, \" \");
for (i = 1; i <= len; ++i) {
printf(\" %s%s\\n\", prefix, vlist[i]);
}
next;
......@@ -58,12 +58,12 @@ set_variable_value() {
sort_files() {
for FILE in $@; do
echo $FILE
done | sort | uniq
done | LC_ALL=C sort | uniq
}
MAKEFILE=../src/Makefile.am
CMAKE_DIR=.
EXTRACT_INCLUDES_BAT=../vsprojects/extract_includes.bat
EXTRACT_INCLUDES_BAT=extract_includes.bat.in
[ -f "$MAKEFILE" ] || {
echo "Cannot find: $MAKEFILE"
......@@ -105,10 +105,17 @@ set_variable_value $CMAKE_DIR/tests.cmake tests_files $COMMON_PREFIX $TEST_SOURC
set_variable_value $CMAKE_DIR/tests.cmake lite_test_files $COMMON_PREFIX $LITE_TEST_SOURCES
# Generate extract_includes.bat
for HEADER in $HEADERS; do
echo $(dirname $HEADER) | sed "s/\\//\\\\/g"
done | sort | uniq | sed "s/^/mkdir include\\\\/" > $EXTRACT_INCLUDES_BAT
for HEADER in $HEADERS; do
WINPATH=$(echo $HEADER | sed 's;/;\\\\;g')
echo "copy ..\\src\\$WINPATH include\\$WINPATH" >> $EXTRACT_INCLUDES_BAT
echo "mkdir include" > $EXTRACT_INCLUDES_BAT
for HEADER in $PUBLIC_HEADERS; do
HEADER_DIR=$(dirname $HEADER)
while [ ! "$HEADER_DIR" = "." ]; do
echo $HEADER_DIR | sed "s/\\//\\\\/g"
HEADER_DIR=$(dirname $HEADER_DIR)
done
done | sort | uniq | sed "s/^/mkdir include\\\\/" >> $EXTRACT_INCLUDES_BAT
for HEADER in $PUBLIC_HEADERS; do
WINPATH=$(echo $HEADER | sed 's;/;\\;g')
echo "copy \${PROTOBUF_SOURCE_WIN32_PATH}\\..\\src\\$WINPATH include\\$WINPATH" >> $EXTRACT_INCLUDES_BAT
done
# Add pbconfig.h.
echo "copy \${PROTOBUF_BINARY_WIN32_PATH}\\google\\protobuf\\stubs\\pbconfig.h include\\google\\protobuf\\stubs\\pbconfig.h" >> $EXTRACT_INCLUDES_BAT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment