-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add VCPKG_POST_PORTFILE_INCLUDES (#1417)
- Loading branch information
Showing
16 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
9 changes: 9 additions & 0 deletions
9
azure-pipelines/e2e-ports/post-portfile-includes-fail/post-portfile-includes.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set(VCPKG_TARGET_ARCHITECTURE x64) | ||
set(VCPKG_CRT_LINKAGE dynamic) | ||
set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
if(APPLE) | ||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
elseif(UNIX) | ||
set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
endif() | ||
set(VCPKG_POST_PORTFILE_INCLUDES "${CMAKE_CURRENT_LIST_DIR}/invalid.extension") |
1 change: 1 addition & 0 deletions
1
...pelines/e2e-ports/post-portfile-includes-fail/vcpkg-post-portfile-includes/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
5 changes: 5 additions & 0 deletions
5
...e-pipelines/e2e-ports/post-portfile-includes-fail/vcpkg-post-portfile-includes/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "vcpkg-post-portfile-includes", | ||
"version": "0", | ||
"description": "A port to test post portfile includes" | ||
} |
9 changes: 9 additions & 0 deletions
9
azure-pipelines/e2e-ports/post-portfile-includes/post-portfile-includes.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set(VCPKG_TARGET_ARCHITECTURE x64) | ||
set(VCPKG_CRT_LINKAGE dynamic) | ||
set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
if(APPLE) | ||
set(VCPKG_CMAKE_SYSTEM_NAME Darwin) | ||
elseif(UNIX) | ||
set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
endif() | ||
set(VCPKG_POST_PORTFILE_INCLUDES "${CMAKE_CURRENT_LIST_DIR}/test1.cmake;${CMAKE_CURRENT_LIST_DIR}/test2.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Just a random comment | ||
set(VCPKG_POST_INCLUDE_CHECK_TEST2 ON) |
10 changes: 10 additions & 0 deletions
10
azure-pipelines/e2e-ports/post-portfile-includes/test2.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
if(NOT VCPKG_POST_INCLUDE_CHECK_TEST1) | ||
message(FATAL_ERROR "VCPKG_POST_INCLUDE_CHECK_TEST1 failed") | ||
endif() | ||
|
||
if(NOT VCPKG_POST_INCLUDE_CHECK_TEST2) | ||
message(FATAL_ERROR "VCPKG_POST_INCLUDE_CHECK_TEST2 failed") | ||
endif() | ||
|
||
message(STATUS "VCPKG_POST_INCLUDE_CHECK_TEST successful") |
35 changes: 35 additions & 0 deletions
35
azure-pipelines/e2e-ports/post-portfile-includes/vcpkg-post-portfile-includes/portfile.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
file(STRINGS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}.vcpkg_abi_info.txt" lines) | ||
list(FILTER lines INCLUDE REGEX "post_portfile_include_(0|1)") | ||
list(GET lines 0 first_line) | ||
list(GET lines 1 second_line) | ||
|
||
set(expected1 "post_portfile_include_0 ad6ac07ed1e066eaf23af161afb36b25a3ec03af49cd3e52ceb3a91d388f23f8") | ||
set(expected2 "post_portfile_include_1 f8b37330094530b0fc7a5606fea7b491ec0e67edd1fd8f7e1a5607f7be0a3ff2") | ||
|
||
if(first_line STREQUAL "${expected1}") | ||
message(STATUS "ABI hash succesful!") | ||
else() | ||
message(FATAL_ERROR "First line in abi info is not the post include file to be hashed but:\n first_line: '${first_line}'\n expected: '${expected1}' ") | ||
endif() | ||
if(second_line STREQUAL "${expected2}") | ||
message(STATUS "ABI hash succesful!") | ||
else() | ||
message(FATAL_ERROR "Second line in abi info is not the second post include file to be hashed but:\n second_line: '${second_line}'\n expected: '${expected2}' ") | ||
endif() | ||
|
||
if(NOT Z_VCPKG_POST_PORTFILE_INCLUDES) | ||
message(FATAL_ERROR "Variable Z_VCPKG_POST_PORTFILE_INCLUDES not set by vcpkg-tool!") | ||
endif() | ||
|
||
set(path1 "${CMAKE_CURRENT_LIST_DIR}/../test1.cmake") | ||
cmake_path(NORMAL_PATH path1) | ||
set(path2 "${CMAKE_CURRENT_LIST_DIR}/../test2.cmake") | ||
cmake_path(NORMAL_PATH path2) | ||
|
||
if(NOT Z_VCPKG_POST_PORTFILE_INCLUDES STREQUAL "${path1};${path2}") | ||
message(FATAL_ERROR "Z_VCPKG_POST_PORTFILE_INCLUDES ist not equal to '${path1};${path2}' (Z_VCPKG_POST_PORTFILE_INCLUDES:'${Z_VCPKG_POST_PORTFILE_INCLUDES}') ") | ||
endif() | ||
|
||
set(VCPKG_POST_INCLUDE_CHECK_TEST1 ON) | ||
|
||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled) |
5 changes: 5 additions & 0 deletions
5
azure-pipelines/e2e-ports/post-portfile-includes/vcpkg-post-portfile-includes/vcpkg.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "vcpkg-post-portfile-includes", | ||
"version": "0", | ||
"description": "A port to test post portfile includes" | ||
} |
23 changes: 23 additions & 0 deletions
23
azure-pipelines/end-to-end-tests-dir/post-portfile-includes.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
. $PSScriptRoot/../end-to-end-tests-prelude.ps1 | ||
|
||
Run-Vcpkg @directoryArgs ` | ||
"--overlay-triplets=$PSScriptRoot/../e2e-ports/post-portfile-includes" ` | ||
"--overlay-ports=$PSScriptRoot/../e2e-ports/post-portfile-includes" ` | ||
x-set-installed ` | ||
vcpkg-post-portfile-includes ` | ||
--host-triplet post-portfile-includes ` | ||
--binarysource=clear | ||
Throw-IfFailed | ||
|
||
$output = Run-VcpkgAndCaptureOutput @directoryArgs ` | ||
"--overlay-triplets=$PSScriptRoot/../e2e-ports/post-portfile-includes-fail" ` | ||
"--overlay-ports=$PSScriptRoot/../e2e-ports/post-portfile-includes-fail" ` | ||
x-set-installed ` | ||
vcpkg-post-portfile-includes ` | ||
--host-triplet post-portfile-includes ` | ||
--binarysource=clear | ||
Throw-IfNotFailed | ||
if ($output -notmatch "Variable VCPKG_POST_PORTFILE_INCLUDES contains invalid file path") | ||
{ | ||
throw "Expected to fail since VCPKG_POST_PORTFILE_INCLUDES is set to a relative path" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters