Skip to content

Commit

Permalink
[glib]Fix missing dependency selinux. (#7988)
Browse files Browse the repository at this point in the history
* [glib]Fix missing dependency selinux.

* [glib]Improve warning message.

* [sdl1]Set selinux to a feature.

* Update portfile.cmake
  • Loading branch information
JackBoosY authored and cbezault committed Sep 16, 2019
1 parent d7e0ee4 commit 741106f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ports/glib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,14 @@ if(WIN32)
target_link_libraries(gio PRIVATE ws2_32 shlwapi dnsapi iphlpapi advapi32 shell32)
elseif(APPLE)
target_link_libraries(gio PRIVATE xdgmime kqueue)
if (HAVE_SELINUX)
target_link_libraries(gio PRIVATE selinux)
endif()
else()
target_link_libraries(gio PRIVATE xdgmime inotify)
if (HAVE_SELINUX)
target_link_libraries(gio PRIVATE selinux)
endif()
endif()
list(APPEND GLIB_TARGETS gio)

Expand Down
3 changes: 3 additions & 0 deletions ports/glib/CONTROL
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Version: 2.52.3-14-3
Homepage: https://developer.gnome.org/glib/
Description: Portable, general-purpose utility library.
Build-Depends: zlib, pcre, libffi, gettext, libiconv

Feature: selinux
Description: Build with selinux support.
10 changes: 9 additions & 1 deletion ports/glib/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ file(REMOVE_RECURSE ${SOURCE_PATH}/glib/pcre)
file(WRITE ${SOURCE_PATH}/glib/pcre/Makefile.in)
file(REMOVE ${SOURCE_PATH}/glib/win_iconv.c)

if (selinux IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS AND NOT EXISTS "/usr/include/selinux")
message("Selinux was not found in its typical system location. Your build may fail. You can install Selinux with \"apt-get install selinux\".")
endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
selinux HAVE_SELINUX
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
OPTIONS ${FEATURE_OPTIONS}
-DGLIB_VERSION=${GLIB_VERSION}
OPTIONS_DEBUG
-DGLIB_SKIP_HEADERS=ON
Expand Down

0 comments on commit 741106f

Please sign in to comment.