[glib][atk] Disable static builds, fix generation to happen outside the source directory

This commit is contained in:
Robert Schumacher 2018-03-05 12:07:43 -08:00
parent 6675327606
commit 26fabaf880
6 changed files with 29 additions and 23 deletions

View File

@ -11,21 +11,26 @@ endif()
# generate atkmarshal.c and atkmarshal.h source files # generate atkmarshal.c and atkmarshal.h source files
# glib-genmarshal should be installed along with glib # glib-genmarshal should be installed along with glib
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h OR NOT EXISTS ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c) find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib)
find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/atk)
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --header
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.h)
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal atkmarshal.list --body
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_SOURCE_DIR}/atk/atkmarshal.c)
endif()
configure_file(config.h.win32 ${CMAKE_SOURCE_DIR}/config.h COPYONLY) message("Generating atkmarshal.h: ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header")
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --header
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.h
)
message("Generating atkmarshal.c: ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body")
execute_process(
COMMAND ${GLIB_GENMARSHAL} --prefix=atk_marshal ${CMAKE_CURRENT_SOURCE_DIR}/atk/atkmarshal.list --body
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/atk
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/atk/atkmarshal.c
)
configure_file(config.h.win32 ${CMAKE_CURRENT_BINARY_DIR}/config.h COPYONLY)
add_definitions(-DHAVE_CONFIG_H) add_definitions(-DHAVE_CONFIG_H)
include_directories(. ./atk) include_directories(. ./atk ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/atk)
find_path(GLIB_INCLUDE_DIR glib.h) find_path(GLIB_INCLUDE_DIR glib.h)
find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION}) find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION})

View File

@ -1,4 +1,4 @@
Source: atk Source: atk
Version: 2.24.0-1 Version: 2.24.0-2
Description: GNOME Accessibility Toolkit Description: GNOME Accessibility Toolkit
Build-Depends: glib, gettext Build-Depends: glib, gettext

View File

@ -1,7 +1,6 @@
# ATK uses DllMain # ATK uses DllMain
if (VCPKG_LIBRARY_LINKAGE STREQUAL static) if (VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_CRT_LINKAGE STREQUAL "static")
message(STATUS "Warning: Static building not supported. Building dynamic.") message(FATAL_ERROR "ATK only supports dynamic library and crt linkage")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif() endif()
include(vcpkg_common_functions) include(vcpkg_common_functions)

View File

@ -27,6 +27,8 @@ find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX})
# libiconv # libiconv
find_path(ICONV_INCLUDE_DIR iconv.h) find_path(ICONV_INCLUDE_DIR iconv.h)
find_library(ICONV_LIBRARY NAMES iconv libiconv) find_library(ICONV_LIBRARY NAMES iconv libiconv)
# libiconv
find_library(CHARSET_LIBRARY NAMES charset libcharset)
# libffi # libffi
find_path(FFI_INCLUDE_DIR ffi.h) find_path(FFI_INCLUDE_DIR ffi.h)
find_library(FFI_LIBRARY NAMES ffi libffi) find_library(FFI_LIBRARY NAMES ffi libffi)
@ -64,7 +66,7 @@ extract_vcproj_sources(win32/vs14/glib.vcxproj GLIB_SOURCES)
list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols list(APPEND GLIB_SOURCES glib/libcharset/localcharset.c) # modified internal version with prefixed symbols
add_library(glib ${GLIB_SOURCES}) add_library(glib ${GLIB_SOURCES})
target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR) target_compile_definitions(glib PRIVATE USE_SYSTEM_PCRE ${GLIB_EXPORT_MACRO} GLIB_COMPILATION G_LOG_DOMAIN="GLib" LIBDIR)
target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${LIBINTL_LIBRARY}) target_link_libraries(glib ws2_32 winmm ${PCRE_LIBRARY} ${ICONV_LIBRARY} ${CHARSET_LIBRARY} ${LIBINTL_LIBRARY})
target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR}) target_include_directories(glib PRIVATE ${PCRE_INCLUDE_DIR} ${ICONV_INCLUDE_DIR})
target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR}) target_include_directories(glib PUBLIC ${LIBINTL_INCLUDE_DIR})
list(APPEND GLIB_TARGETS glib) list(APPEND GLIB_TARGETS glib)
@ -161,5 +163,6 @@ message(STATUS "Link-time dependencies:")
message(STATUS " " ${ZLIB_LIBRARIES}) message(STATUS " " ${ZLIB_LIBRARIES})
message(STATUS " " ${PCRE_LIBRARY}) message(STATUS " " ${PCRE_LIBRARY})
message(STATUS " " ${ICONV_LIBRARY}) message(STATUS " " ${ICONV_LIBRARY})
message(STATUS " " ${CHARSET_LIBRARY})
message(STATUS " " ${FFI_LIBRARY}) message(STATUS " " ${FFI_LIBRARY})
message(STATUS " " ${LIBINTL_LIBRARY}) message(STATUS " " ${LIBINTL_LIBRARY})

View File

@ -1,4 +1,4 @@
Source: glib Source: glib
Version: 2.52.3-1 Version: 2.52.3-2
Description: Portable, general-purpose utility library. Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv Build-Depends: zlib, pcre, libffi, gettext, libiconv

View File

@ -1,12 +1,11 @@
# Glib uses winapi functions not available in WindowsStore # Glib uses winapi functions not available in WindowsStore
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
message(FATAL_ERROR "Error: UWP builds are currently not supported.") message(FATAL_ERROR "Error: UWP builds are currently not supported.")
endif() endif()
# Glib relies on DllMain # Glib relies on DllMain
if (VCPKG_LIBRARY_LINKAGE STREQUAL static) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_CRT_LINKAGE STREQUAL "static")
message(STATUS "Warning: Static building not supported. Building dynamic.") message(FATAL_ERROR "Glib only supports dynamic library and crt linkage")
set(VCPKG_LIBRARY_LINKAGE dynamic)
endif() endif()
include(vcpkg_common_functions) include(vcpkg_common_functions)