Navigation Menu

Skip to content

Commit

Permalink
windows: install PDB to lib\pdb
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 19, 2017
1 parent e6e2aff commit b899e32
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -84,6 +84,7 @@ 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
6 changes: 3 additions & 3 deletions appveyor.yml
Expand Up @@ -55,8 +55,8 @@ build_script:
-DGRN_WITH_BUNDLED_MECAB=yes
-DGRN_WITH_BUNDLED_MESSAGE_PACK=yes
-DGRN_WITH_BUNDLED_LZ4=yes
- cmake --build . --config Debug
- cmake --build . --config Debug --target Install
- cmake --build . --config RelWithDebInfo
- cmake --build . --config RelWithDebInfo --target Install

before_test:
- git clone --depth 1
Expand All @@ -75,6 +75,6 @@ test_script:
test\command\suite

on_success:
- set ARTIFACT=%GROONGA_INSTALL_FOLDER%.7z
- set ARTIFACT=%GROONGA_INSTALL_FOLDER%.zip
- 7z a %ARTIFACT% %GROONGA_INSTALL_FOLDER%
- ps: Push-AppveyorArtifact $Env:ARTIFACT
3 changes: 3 additions & 0 deletions lib/CMakeLists.txt
Expand Up @@ -119,6 +119,9 @@ else()
ARCHIVE DESTINATION "${LIB_DIR}"
LIBRARY DESTINATION "${LIB_DIR}"
RUNTIME DESTINATION "${BIN_DIR}")
install(FILES $<TARGET_PDB_FILE:libgroonga>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()

if(GRN_WITH_MRUBY)
Expand Down
13 changes: 8 additions & 5 deletions lib/ctx.c
Expand Up @@ -1617,11 +1617,14 @@ exception_filter(EXCEPTION_POINTERS *info)
*current = *base_dir;
}
}
if ((current + strlen("\\bin") + 1) < end) {
(*current++) = '\\';
(*current++) = 'b';
(*current++) = 'i';
(*current++) = 'n';
{
const char *pdb_dir = "\\lib\\pdb";
size_t pdb_dir_length;
pdb_dir_length = strlen(pdb_dir);
if ((current + pdb_dir_length + 1) < end) {
grn_strncat(current, pdb_dir_length + 1, pdb_dir, pdb_dir_length);
current += pdb_dir_length;
}
}
*current = '\0';
}
Expand Down
6 changes: 6 additions & 0 deletions plugins/functions/CMakeLists.txt
Expand Up @@ -36,6 +36,9 @@ else()
PREFIX ""
OUTPUT_NAME "vector")
install(TARGETS vector_functions DESTINATION "${GRN_FUNCTIONS_PLUGIN_DIR}")
install(FILES $<TARGET_PDB_FILE:vector_functions>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(vector_functions libgroonga)

Expand All @@ -56,6 +59,9 @@ else()
PREFIX ""
OUTPUT_NAME "string")
install(TARGETS string_functions DESTINATION "${GRN_FUNCTIONS_PLUGIN_DIR}")
install(FILES $<TARGET_PDB_FILE:string_functions>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(string_functions libgroonga)

Expand Down
3 changes: 3 additions & 0 deletions plugins/query_expanders/CMakeLists.txt
Expand Up @@ -34,5 +34,8 @@ else()
PREFIX ""
OUTPUT_NAME "tsv")
install(TARGETS tsv_query_expander DESTINATION "${QUERY_EXPANDERS_DIR}")
install(FILES $<TARGET_PDB_FILE:tsv_query_expander>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(tsv_query_expander libgroonga)
3 changes: 3 additions & 0 deletions plugins/suggest/CMakeLists.txt
Expand Up @@ -32,5 +32,8 @@ else()
add_library(suggest MODULE ${SUGGEST_SOURCES})
set_target_properties(suggest PROPERTIES PREFIX "")
install(TARGETS suggest DESTINATION "${GRN_RELATIVE_PLUGINS_DIR}/suggest")
install(FILES $<TARGET_PDB_FILE:suggest>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(suggest libgroonga)
6 changes: 6 additions & 0 deletions plugins/token_filters/CMakeLists.txt
Expand Up @@ -36,6 +36,9 @@ else()
PREFIX ""
OUTPUT_NAME "stop_word")
install(TARGETS stop_word_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
install(FILES $<TARGET_PDB_FILE:stop_word_token_filter>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(stop_word_token_filter libgroonga)

Expand All @@ -58,6 +61,9 @@ if(GRN_WITH_LIBSTEMMER)
PREFIX ""
OUTPUT_NAME "stem")
install(TARGETS stem_token_filter DESTINATION "${TOKEN_FILTERS_DIR}")
install(FILES $<TARGET_PDB_FILE:stem_token_filter>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(stem_token_filter libgroonga ${LIBSTEMMER_LIBRARIES})
endif()
6 changes: 6 additions & 0 deletions plugins/tokenizers/CMakeLists.txt
Expand Up @@ -48,6 +48,9 @@ if(GRN_WITH_MECAB)
PREFIX ""
OUTPUT_NAME "mecab")
install(TARGETS mecab_tokenizer DESTINATION "${TOKENIZERS_DIR}")
install(FILES $<TARGET_PDB_FILE:mecab_tokenizer>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(mecab_tokenizer libgroonga ${MECAB_LIBRARIES})
endif()
Expand All @@ -71,6 +74,9 @@ if(GRN_WITH_KYTEA)
PREFIX ""
OUTPUT_NAME "kytea")
install(TARGETS kytea_tokenizer DESTINATION "${TOKENIZERS_DIR}")
install(FILES $<TARGET_PDB_FILE:kytea_tokenizer>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
target_link_libraries(kytea_tokenizer libgroonga ${KYTEA_LIBRARIES})
endif()
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -27,6 +27,9 @@ set_source_files_properties(${GROONGA_SOURCES}
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
target_link_libraries(groonga libgroonga)
install(TARGETS groonga DESTINATION ${BIN_DIR})
install(FILES $<TARGET_PDB_FILE:groonga>
DESTINATION "${PDB_DIR}"
OPTIONAL)

if(GRN_WITH_MRUBY)
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/grndb_sources.am GRNDB_SOURCES)
Expand All @@ -39,6 +42,9 @@ if(GRN_WITH_MRUBY)
COMPILE_DEFINITIONS "${MRUBY_DEFINITIONS}")
target_link_libraries(grndb libgroonga)
install(TARGETS grndb DESTINATION ${BIN_DIR})
install(FILES $<TARGET_PDB_FILE:grndb>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()

if(NOT WIN32)
Expand All @@ -59,4 +65,7 @@ set_source_files_properties(${GROONGA_BENCHMARK_SOURCES}
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
target_link_libraries(groonga-benchmark libgroonga)
install(TARGETS groonga-benchmark DESTINATION ${BIN_DIR})
install(FILES $<TARGET_PDB_FILE:groonga-benchmark>
DESTINATION "${PDB_DIR}"
OPTIONAL)

9 changes: 9 additions & 0 deletions src/suggest/CMakeLists.txt
Expand Up @@ -29,6 +29,9 @@ target_link_libraries(groonga-suggest-create-dataset libgroonga)
install(
TARGETS groonga-suggest-create-dataset
DESTINATION ${BIN_DIR})
install(FILES $<TARGET_PDB_FILE:groonga-suggest-create-dataset>
DESTINATION "${PDB_DIR}"
OPTIONAL)

if(GRN_WITH_LIBEVENT AND GRN_WITH_ZEROMQ AND GRN_WITH_MESSAGE_PACK)
set(GRN_WITH_SUGGEST_LEARNER TRUE)
Expand Down Expand Up @@ -84,4 +87,10 @@ if(GRN_WITH_SUGGEST_LEARNER)
install(
TARGETS groonga-suggest-learner groonga-suggest-httpd
DESTINATION ${BIN_DIR})
install(
FILES
$<TARGET_PDB_FILE:groonga-suggest-learner>
$<TARGET_PDB_FILE:groonga-suggest-httpd>
DESTINATION "${PDB_DIR}"
OPTIONAL)
endif()
3 changes: 3 additions & 0 deletions vendor/lz4/CMakeLists.txt
Expand Up @@ -83,6 +83,9 @@ if(GRN_WITH_BUNDLED_LZ4)
RUNTIME DESTINATION "${BIN_DIR}")
install(TARGETS lz4
DESTINATION "${BIN_DIR}")
install(FILES $<TARGET_PDB_FILE:lz4>
DESTINATION "${PDB_DIR}"
OPTIONAL)
install(FILES
"${LZ4_SOURCE_DIR}/lib/lz4.h"
"${LZ4_SOURCE_DIR}/lib/lz4frame.h"
Expand Down
7 changes: 7 additions & 0 deletions vendor/mecab/CMakeLists.txt
Expand Up @@ -173,6 +173,13 @@ if(GRN_WITH_BUNDLED_MECAB)
DESTINATION "${BIN_DIR}")
install(TARGETS mecab-dict-index
DESTINATION "${BIN_DIR}")
install(
FILES
$<TARGET_PDB_FILE:libmecab>
$<TARGET_PDB_FILE:mecab>
$<TARGET_PDB_FILE:mecab-dict-index>
DESTINATION "${PDB_DIR}"
OPTIONAL)
install(FILES "${MECAB_SOURCE_DIR}/src/mecab.h"
DESTINATION "${INCLUDE_DIR}")

Expand Down
3 changes: 3 additions & 0 deletions vendor/message_pack/CMakeLists.txt
Expand Up @@ -41,6 +41,9 @@ if(GRN_WITH_BUNDLED_MESSAGE_PACK)
ARCHIVE DESTINATION "${LIB_DIR}"
LIBRARY DESTINATION "${LIB_DIR}"
RUNTIME DESTINATION "${BIN_DIR}")
install(FILES $<TARGET_PDB_FILE:msgpackc>
DESTINATION "${PDB_DIR}"
OPTIONAL)
install(DIRECTORY
"${MESSAGE_PACK_SOURCE_DIR}/include/"
DESTINATION "${INCLUDE_DIR}"
Expand Down

0 comments on commit b899e32

Please sign in to comment.