Skip to content

Commit

Permalink
add VCPKG_(PRE|POST)_PORTFILE_INCLUDES
Browse files Browse the repository at this point in the history
  • Loading branch information
Neumann-A committed Jul 18, 2022
1 parent 28f7523 commit bb632f9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/users/triplets.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ See the [`"supports"`](../maintainers/manifest-files.md#supports) manifest file

When this option is set to (true|1|on), the compiler is ignored in the abi tracking.

### VCPKG_(PRE|POST)_PORTFILE_INCLUDES

List of cmake files to include (before|after) the portfile is included.
Can be used to setup the environment or change the build artifacts after they have been etablished.

## Windows Variables

<a name="VCPKG_ENV_PASSTHROUGH"></a>
Expand Down
11 changes: 11 additions & 0 deletions scripts/ports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,18 @@ if(CMD STREQUAL "BUILD")
set(Z_VCPKG_ERROR_LOG_COLLECTION_FILE "${CURRENT_BUILDTREES_DIR}/error-logs-${TARGET_TRIPLET}.txt")
file(REMOVE "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}")

foreach(z_pre_portfile_include IN LISTS VCPKG_PRE_PORTFILE_INCLUDES)
include("${z_pre_portfile_include}")
endforeach()
unset(z_pre_portfile_include)

include("${CURRENT_PORT_DIR}/portfile.cmake")

foreach(z_post_portfile_include IN LISTS VCPKG_POST_PORTFILE_INCLUDES)
include("${z_post_portfile_include}")
endforeach()
unset(z_post_portfile_include)

if(DEFINED PORT)
if(VCPKG_FIXUP_ELF_RPATH)
include("${SCRIPTS}/cmake/z_vcpkg_fixup_rpath.cmake")
Expand Down
2 changes: 2 additions & 0 deletions scripts/vcpkg_get_tags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ VCPKG_BUILD_TYPE=${VCPKG_BUILD_TYPE}
VCPKG_LIBRARY_LINKAGE=${VCPKG_LIBRARY_LINKAGE}
VCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}
VCPKG_DISABLE_COMPILER_TRACKING=${VCPKG_DISABLE_COMPILER_TRACKING}
VCPKG_PRE_PORTFILE_INCLUDES=${VCPKG_PRE_PORTFILE_INCLUDES}
VCPKG_POST_PORTFILE_INCLUDES=${VCPKG_POST_PORTFILE_INCLUDES}
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f")

# Just to enforce the user didn't set it in the triplet file
Expand Down

0 comments on commit bb632f9

Please sign in to comment.