mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 12:53:02 +08:00
[glib]Fix linux build. (#8653)
This commit is contained in:
parent
63a030ad62
commit
5222ad308f
@ -73,33 +73,39 @@ else()
|
|||||||
set(ENV{PCRE_CFLAGS} "-I${PCRE_INCLUDE_DIR}")
|
set(ENV{PCRE_CFLAGS} "-I${PCRE_INCLUDE_DIR}")
|
||||||
set(ENV{MSGFMT} "/bin/echo")
|
set(ENV{MSGFMT} "/bin/echo")
|
||||||
set(ENV{GMSGFMT} "/bin/echo")
|
set(ENV{GMSGFMT} "/bin/echo")
|
||||||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/config/config.h")
|
string(TOUPPER UPPER_CONFIG "${CMAKE_BUILD_TYPE}")
|
||||||
string(TOUPPER UPPER_CONFIG "${CMAKE_BUILD_TYPE}")
|
set(CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CONFIG}} -I${PCRE_INCLUDE_DIR}")
|
||||||
set(CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${UPPER_CONFIG}} -I${PCRE_INCLUDE_DIR}")
|
set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPER_CONFIG}} -I${PCRE_INCLUDE_DIR}")
|
||||||
set(CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${UPPER_CONFIG}} -I${PCRE_INCLUDE_DIR}")
|
if(BUILD_SHARED_LIBS)
|
||||||
if(BUILD_SHARED_LIBS)
|
set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${UPPER_CONFIG}} -L${LIB_DIR}")
|
||||||
set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${UPPER_CONFIG}} -L${LIB_DIR}")
|
else()
|
||||||
else()
|
set(LDFLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_STATIC_LINKER_FLAGS_${UPPER_CONFIG}} -L${LIB_DIR}")
|
||||||
set(LDFLAGS "${CMAKE_STATIC_LINKER_FLAGS} ${CMAKE_STATIC_LINKER_FLAGS_${UPPER_CONFIG}} -L${LIB_DIR}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
string(STRIP "${CXXFLAGS}" CXXFLAGS)
|
|
||||||
string(STRIP "${CFLAGS}" CFLAGS)
|
|
||||||
string(STRIP "${LDFLAGS}" LDFLAGS)
|
|
||||||
execute_process(
|
|
||||||
COMMAND "${CMAKE_SOURCE_DIR}/configure"
|
|
||||||
--disable-libelf
|
|
||||||
--disable-libmount
|
|
||||||
"CPPFLAGS=${CXXFLAGS}"
|
|
||||||
"CFLAGS=${CFLAGS}"
|
|
||||||
"LDFLAGS=${LDFLAGS}"
|
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/config
|
|
||||||
RESULT_VARIABLE res
|
|
||||||
)
|
|
||||||
if(NOT res EQUAL 0)
|
|
||||||
message(FATAL_ERROR "Configure failed.")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
string(STRIP "${CXXFLAGS}" CXXFLAGS)
|
||||||
|
string(STRIP "${CFLAGS}" CFLAGS)
|
||||||
|
string(STRIP "${LDFLAGS}" LDFLAGS)
|
||||||
|
execute_process(
|
||||||
|
COMMAND "${CMAKE_SOURCE_DIR}/configure"
|
||||||
|
--disable-libelf
|
||||||
|
--disable-libmount
|
||||||
|
"CPPFLAGS=${CXXFLAGS}"
|
||||||
|
"CFLAGS=${CFLAGS}"
|
||||||
|
"LDFLAGS=${LDFLAGS}"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/config
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
)
|
||||||
|
if(NOT res EQUAL 0)
|
||||||
|
message(FATAL_ERROR "Configure failed.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT HAVE_SELINUX)
|
||||||
|
file(READ "${CMAKE_BINARY_DIR}/config/config.h" CONFIG_H)
|
||||||
|
string(REPLACE "#define HAVE_SELINUX 1"
|
||||||
|
"#undef HAVE_SELINUX" CONFIG_H "${CONFIG_H}")
|
||||||
|
file(WRITE "${CMAKE_BINARY_DIR}/config/config.h" "${CONFIG_H}")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions("-DGIO_MODULE_DIR=\"gio/modules\"")
|
add_definitions("-DGIO_MODULE_DIR=\"gio/modules\"")
|
||||||
endif()
|
endif()
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/config/config.h DESTINATION include/glib)
|
install(FILES ${CMAKE_BINARY_DIR}/config/config.h DESTINATION include/glib)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Source: glib
|
Source: glib
|
||||||
Version: 2.52.3-14-3
|
Version: 2.52.3-14-4
|
||||||
Homepage: https://developer.gnome.org/glib/
|
Homepage: https://developer.gnome.org/glib/
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user