Navigation Menu

Skip to content

Commit

Permalink
Use the same directory as .dll/.exe for .pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Feb 18, 2018
1 parent 8fe58e3 commit b49f803
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 33 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -84,7 +84,6 @@ option(GRN_EMBED
set(BIN_DIR "bin")
set(SBIN_DIR "sbin")
set(LIB_DIR "lib")
set(PDB_DIR "${LIB_DIR}/pdb")
set(INCLUDE_DIR "include")
set(GRN_INCLUDE_DIR "include/groonga")
set(DATA_DIR "share")
Expand Down
4 changes: 2 additions & 2 deletions lib/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2012-2016 Brazil
# Copyright(C) 2012-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -121,7 +121,7 @@ else()
RUNTIME DESTINATION "${BIN_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:libgroonga>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()
endif()
Expand Down
5 changes: 3 additions & 2 deletions lib/ctx.c
Expand Up @@ -1633,7 +1633,8 @@ exception_filter(EXCEPTION_POINTERS *info)
base_dir = grn_windows_base_dir();
{
char *current, *end;
const char *pdb_dir = "\\lib\\pdb";
/* TODO: Add more directories for plugins and so on. */
const char *bin_dir = "\\bin";
current = search_path + strlen(search_path);
end = current + sizeof(search_path) - 1;
for (; *base_dir && current < end; base_dir++, current++) {
Expand All @@ -1647,7 +1648,7 @@ exception_filter(EXCEPTION_POINTERS *info)
current--;
}
*current = '\0';
grn_strcat(search_path, sizeof(search_path), pdb_dir);
grn_strcat(search_path, sizeof(search_path), bin_dir);
}

SymSetSearchPath(process, search_path);
Expand Down
3 changes: 1 addition & 2 deletions packages/windows/Rakefile
Expand Up @@ -516,15 +516,14 @@ namespace :pdb do
generate_pdb_bat.open("w") do |bat|
cd(binary_dir) do
Dir.glob("**/*.{exe,dll}") do |binary|
pdb = "lib\\pdb\\" + File.basename(binary, ".*") + ".pdb"
binary = binary.gsub("/", "\\")
pdb = binary.gsub(/\.(?:exe|dll)\z/, ".pdb")
bat.print("bin\\#{cv2pdb.basename} #{binary} #{binary} #{pdb}\r\n")
end
end
end
chmod(0755, generate_pdb_bat)
cp(cv2pdb, bin_dir)
mkdir_p(lib_dir + "pdb")

cv2pdb_license_dir = license_dir + "cv2pdb"
mkdir_p(cv2pdb_license_dir)
Expand Down
6 changes: 3 additions & 3 deletions plugins/functions/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2015-2017 Brazil
# Copyright(C) 2015-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -38,7 +38,7 @@ else()
install(TARGETS vector_functions DESTINATION "${GRN_FUNCTIONS_PLUGIN_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:vector_functions>
DESTINATION "${PDB_DIR}"
DESTINATION "${GRN_FUNCTIONS_PLUGIN_DIR}"
OPTIONAL)
endif()
endif()
Expand All @@ -63,7 +63,7 @@ else()
install(TARGETS string_functions DESTINATION "${GRN_FUNCTIONS_PLUGIN_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:string_functions>
DESTINATION "${PDB_DIR}"
DESTINATION "${GRN_FUNCTIONS_PLUGIN_DIR}"
OPTIONAL)
endif()
endif()
Expand Down
4 changes: 2 additions & 2 deletions plugins/query_expanders/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2012-2013 Brazil
# Copyright(C) 2012-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -36,7 +36,7 @@ else()
install(TARGETS tsv_query_expander DESTINATION "${QUERY_EXPANDERS_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:tsv_query_expander>
DESTINATION "${PDB_DIR}"
DESTINATION "${QUERY_EXPANDERS_DIR}"
OPTIONAL)
endif()
endif()
Expand Down
7 changes: 4 additions & 3 deletions plugins/suggest/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2012-2013 Brazil
# Copyright(C) 2012-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -18,6 +18,7 @@ include_directories(
${MRUBY_INCLUDE_DIRS}
${MESSAGE_PACK_INCLUDE_DIRS})

set(GRN_SUGGEST_PLUGIN_DIR "${GRN_RELATIVE_PLUGINS_DIR}/suggest")
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am SUGGEST_SOURCES)
set_source_files_properties(${SUGGEST_SOURCES}
PROPERTIES
Expand All @@ -31,10 +32,10 @@ if(GRN_EMBED)
else()
add_library(suggest MODULE ${SUGGEST_SOURCES})
set_target_properties(suggest PROPERTIES PREFIX "")
install(TARGETS suggest DESTINATION "${GRN_RELATIVE_PLUGINS_DIR}/suggest")
install(TARGETS suggest DESTINATION "${GRN_SUGGEST_PLUGIN_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:suggest>
DESTINATION "${PDB_DIR}"
DESTINATION "${GRN_SUGGEST_PLUGIN_DIR}"
OPTIONAL)
endif()
endif()
Expand Down
6 changes: 3 additions & 3 deletions plugins/token_filters/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2014 Brazil
# Copyright(C) 2014-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -38,7 +38,7 @@ else()
install(TARGETS stop_word_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:stop_word_token_filter>
DESTINATION "${PDB_DIR}"
DESTINATION "${TOKEN_FILTERS_DIR}"
OPTIONAL)
endif()
endif()
Expand All @@ -65,7 +65,7 @@ if(GRN_WITH_LIBSTEMMER)
install(TARGETS stem_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:stem_token_filter>
DESTINATION "${PDB_DIR}"
DESTINATION "${TOKEN_FILTERS_DIR}"
OPTIONAL)
endif()
endif()
Expand Down
6 changes: 3 additions & 3 deletions plugins/tokenizers/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2012-2013 Brazil
# Copyright(C) 2012-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -50,7 +50,7 @@ if(GRN_WITH_MECAB)
install(TARGETS mecab_tokenizer DESTINATION "${TOKENIZERS_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:mecab_tokenizer>
DESTINATION "${PDB_DIR}"
DESTINATION "${TOKENIZERS_DIR}"
OPTIONAL)
endif()
endif()
Expand Down Expand Up @@ -78,7 +78,7 @@ if(GRN_WITH_KYTEA)
install(TARGETS kytea_tokenizer DESTINATION "${TOKENIZERS_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:kytea_tokenizer>
DESTINATION "${PDB_DIR}"
DESTINATION "${TOKENIZERS_DIR}"
OPTIONAL)
endif()
endif()
Expand Down
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2012-2013 Brazil
# Copyright(C) 2012-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -29,7 +29,7 @@ target_link_libraries(groonga libgroonga)
install(TARGETS groonga DESTINATION ${BIN_DIR})
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:groonga>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()

Expand All @@ -46,7 +46,7 @@ if(GRN_WITH_MRUBY)
install(TARGETS grndb DESTINATION ${BIN_DIR})
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:grndb>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()
endif()
Expand All @@ -71,7 +71,7 @@ target_link_libraries(groonga-benchmark libgroonga)
install(TARGETS groonga-benchmark DESTINATION ${BIN_DIR})
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:groonga-benchmark>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()

4 changes: 2 additions & 2 deletions src/suggest/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2012-2013 Brazil
# Copyright(C) 2012-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -31,7 +31,7 @@ install(
DESTINATION ${BIN_DIR})
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:groonga-suggest-create-dataset>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()

Expand Down
4 changes: 2 additions & 2 deletions vendor/lz4/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2016 Brazil
# Copyright(C) 2016-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -85,7 +85,7 @@ if(GRN_WITH_BUNDLED_LZ4)
DESTINATION "${BIN_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:lz4>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()
install(FILES
Expand Down
4 changes: 2 additions & 2 deletions vendor/mecab/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2015 Brazil
# Copyright(C) 2015-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -179,7 +179,7 @@ if(GRN_WITH_BUNDLED_MECAB)
$<TARGET_PDB_FILE:libmecab>
$<TARGET_PDB_FILE:mecab>
$<TARGET_PDB_FILE:mecab-dict-index>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()
install(FILES "${MECAB_SOURCE_DIR}/src/mecab.h"
Expand Down
4 changes: 2 additions & 2 deletions vendor/message_pack/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright(C) 2016 Brazil
# Copyright(C) 2016-2018 Brazil
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -43,7 +43,7 @@ if(GRN_WITH_BUNDLED_MESSAGE_PACK)
RUNTIME DESTINATION "${BIN_DIR}")
if(MSVC AND CMAKE_VERSION VERSION_GREATER "3.1")
install(FILES $<TARGET_PDB_FILE:msgpackc>
DESTINATION "${PDB_DIR}"
DESTINATION "${BIN_DIR}"
OPTIONAL)
endif()
install(DIRECTORY
Expand Down

0 comments on commit b49f803

Please sign in to comment.