Skip to content

Commit

Permalink
[xerces-c] Avoid building executables (#4576)
Browse files Browse the repository at this point in the history
  • Loading branch information
ras0219-msft committed Nov 2, 2018
1 parent a589f9f commit cc3fae8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ports/xerces-c/CONTROL
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Source: xerces-c
Version: 3.2.2-4
Version: 3.2.2-5
Description: Xerces-C++ is a XML parser, for parsing, generating, manipulating, and validating XML documents using the DOM, SAX, and SAX2 APIs.
21 changes: 21 additions & 0 deletions ports/xerces-c/disable-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4254f89..aa08565 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -175,10 +175,16 @@ install(
COMPONENT "development")

# Process subdirectories
+if(NOT DISABLE_DOC)
add_subdirectory(doc)
+endif()
add_subdirectory(src)
+if(NOT DISABLE_TESTS)
add_subdirectory(tests)
+endif()
+if(NOT DISABLE_SAMPLES)
add_subdirectory(samples)
+endif()

# Display configuration summary
message(STATUS "")
15 changes: 5 additions & 10 deletions ports/xerces-c/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ vcpkg_from_github(
REF Xerces-C_3_2_2
SHA512 66f60fe9194376ac0ca99d13ea5bce23ada86e0261dde30686c21ceb5499e754dab8eb0a98adadd83522bda62709377715501f6dac49763e3a686f9171cc63ea
HEAD_REF trunk
PATCHES disable-tests.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DDISABLE_TESTS=ON
-DDISABLE_DOC=ON
-DDISABLE_SAMPLES=ON
)

vcpkg_install_cmake()
Expand All @@ -21,16 +26,6 @@ else()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/XercesC TARGET_PATH share/xercesc)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(GLOB release_exe "${CURRENT_PACKAGES_DIR}/bin/*.exe")
file(GLOB debug_exe "${CURRENT_PACKAGES_DIR}/debug/bin/*.exe")
if(release_exe OR debug_exe)
file(REMOVE ${release_exe} ${debug_exe})
endif()
endif()

file(READ ${CURRENT_PACKAGES_DIR}/share/xercesc/XercesCConfigInternal.cmake _contents)
string(REPLACE
"get_filename_component(_IMPORT_PREFIX \"\${_IMPORT_PREFIX}\" PATH)"
Expand Down

0 comments on commit cc3fae8

Please sign in to comment.