mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 17:41:09 +08:00
[glib][atk] Disable static builds, fix generation to happen outside the source directory
This commit is contained in:
parent
6675327606
commit
26fabaf880
@ -11,21 +11,26 @@ endif()
|
||||
|
||||
# generate atkmarshal.c and atkmarshal.h source files
|
||||
# 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)
|
||||
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()
|
||||
find_program(GLIB_GENMARSHAL glib-genmarshal PATH_SUFFIXES glib)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/atk)
|
||||
|
||||
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)
|
||||
include_directories(. ./atk)
|
||||
include_directories(. ./atk ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/atk)
|
||||
|
||||
find_path(GLIB_INCLUDE_DIR glib.h)
|
||||
find_library(GLIB_GLIB_LIBRARY glib-${GLIB_LIB_VERSION})
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: atk
|
||||
Version: 2.24.0-1
|
||||
Version: 2.24.0-2
|
||||
Description: GNOME Accessibility Toolkit
|
||||
Build-Depends: glib, gettext
|
||||
|
@ -1,7 +1,6 @@
|
||||
# ATK uses DllMain
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
message(STATUS "Warning: Static building not supported. Building dynamic.")
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
message(FATAL_ERROR "ATK only supports dynamic library and crt linkage")
|
||||
endif()
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
|
@ -27,6 +27,8 @@ find_library(PCRE_LIBRARY pcre${PCRE_SUFFIX})
|
||||
# libiconv
|
||||
find_path(ICONV_INCLUDE_DIR iconv.h)
|
||||
find_library(ICONV_LIBRARY NAMES iconv libiconv)
|
||||
# libiconv
|
||||
find_library(CHARSET_LIBRARY NAMES charset libcharset)
|
||||
# libffi
|
||||
find_path(FFI_INCLUDE_DIR ffi.h)
|
||||
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
|
||||
add_library(glib ${GLIB_SOURCES})
|
||||
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 PUBLIC ${LIBINTL_INCLUDE_DIR})
|
||||
list(APPEND GLIB_TARGETS glib)
|
||||
@ -161,5 +163,6 @@ message(STATUS "Link-time dependencies:")
|
||||
message(STATUS " " ${ZLIB_LIBRARIES})
|
||||
message(STATUS " " ${PCRE_LIBRARY})
|
||||
message(STATUS " " ${ICONV_LIBRARY})
|
||||
message(STATUS " " ${CHARSET_LIBRARY})
|
||||
message(STATUS " " ${FFI_LIBRARY})
|
||||
message(STATUS " " ${LIBINTL_LIBRARY})
|
||||
|
@ -1,4 +1,4 @@
|
||||
Source: glib
|
||||
Version: 2.52.3-1
|
||||
Version: 2.52.3-2
|
||||
Description: Portable, general-purpose utility library.
|
||||
Build-Depends: zlib, pcre, libffi, gettext, libiconv
|
||||
|
@ -1,12 +1,11 @@
|
||||
# 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.")
|
||||
endif()
|
||||
|
||||
# Glib relies on DllMain
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
message(STATUS "Warning: Static building not supported. Building dynamic.")
|
||||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
message(FATAL_ERROR "Glib only supports dynamic library and crt linkage")
|
||||
endif()
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
|
Loading…
x
Reference in New Issue
Block a user