Skip to content

Commit

Permalink
Revert "[glib] use win_iconv and add subdir for tools"
Browse files Browse the repository at this point in the history
This reverts commit ccd3e39.
  • Loading branch information
codicodi committed Jan 14, 2017
1 parent 5e1c18c commit eb7ccc1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ports/glib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ endmacro()

if(NOT GLIB_SKIP_TOOLS)
configure_file(gobject/glib-mkenums.in ${CMAKE_SOURCE_DIR}/gobject/glib-mkenums @ONLY) # uses GLIB_VERSION
install(FILES gobject/glib-mkenums DESTINATION tools/glib)
install(FILES gobject/glib-mkenums DESTINATION tools)

add_gio_tool(gdbus gio/gdbus-tool.c)
add_gio_tool(gio-querymodules gio/gio-querymodules.c)
Expand All @@ -145,7 +145,7 @@ if(NOT GLIB_SKIP_TOOLS)
add_glib_tool(gspawn-${WIN}-helper WIN32 glib/gspawn-win32-helper.c)
add_glib_tool(gspawn-${WIN}-helper-console glib/gspawn-win32-helper-console.c)

install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools/glib)
install(TARGETS ${GLIB_TOOLS} RUNTIME DESTINATION tools)
endif()

install(TARGETS ${GLIB_TARGETS} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
Expand Down
7 changes: 6 additions & 1 deletion ports/glib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ vcpkg_download_distfile(ARCHIVE
SHA512 63d7b5ece8d7d15b10e06ef10a8e0a4446f30a8d9c97daa3352ec00dfef622728bd42ed24cbf67e553166a0f9e29a3e3d024d1d085b9804fd67608db438b6771)

vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/use-libiconv-on-windows.patch)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/cmake DESTINATION ${SOURCE_PATH})
file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre)
file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
Expand All @@ -30,7 +35,7 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/glib)
vcpkg_copy_tool_dependencies()

file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/glib)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/glib/COPYING ${CURRENT_PACKAGES_DIR}/share/glib/copyright)
Expand Down
14 changes: 14 additions & 0 deletions ports/glib/use-libiconv-on-windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/glib/gconvert.c b/glib/gconvert.c
index 3deac78..134ded9 100644
--- a/glib/gconvert.c
+++ b/glib/gconvert.c
@@ -30,7 +30,8 @@
#include <stdlib.h>

#ifdef G_OS_WIN32
-#include "win_iconv.c"
+#define USE_LIBICONV_GNU
+#include <iconv.h>
#endif

#ifdef G_PLATFORM_WIN32
6 changes: 3 additions & 3 deletions scripts/cmake/vcpkg_copy_tool_dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copy dlls for all tools in TOOL_DIR
# Copy dlls for all tools in ${CURRENT_PACKAGES_DIR}/tools

function(vcpkg_copy_tool_dependencies TOOL_DIR)
function(vcpkg_copy_tool_dependencies)
macro(search_for_dependencies PATH_TO_SEARCH)
file(GLOB TOOLS ${TOOL_DIR}/*.exe ${TOOL_DIR}/*.dll)
file(GLOB TOOLS ${CURRENT_PACKAGES_DIR}/tools/*.exe ${CURRENT_PACKAGES_DIR}/tools/*.dll)
foreach(TOOL ${TOOLS})
execute_process(COMMAND powershell -noprofile -executionpolicy UnRestricted -nologo
-file ${VCPKG_ROOT_DIR}/scripts/buildsystems/msbuild/applocal.ps1
Expand Down

0 comments on commit eb7ccc1

Please sign in to comment.