-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that all post-build checks have skip policies. (#1405)
Also audited for: * Consistently following the 'IDE error format' pointing to portfile.cmake. * Consistently referring to the correct skip policy in the error message where applicable. * Printing paths and other information relative to ${CURRENT_PACKAGES_DIR} or similar as appropriate. * Debug before release. * Don't duplicate messages when a problem happens for both debug and release. Drive by bugfix: if (!build_info.policies.is_enabled(BuildPolicy::ONLY_RELEASE_CRT)) { error_count += check_crt_linkage_of_libs( build_info, false, debug_libs, debug_lib_info.value_or_exit(VCPKG_LINE_INFO), msg_sink); } was wrong; ONLY_RELEASE_CRT should mean 'these should all be release', not 'we aren't even going to look at debug'. It is fixed to: error_count += check_crt_linkage_of_libs(build_info.crt_linkage, build_info.policies.is_enabled(BuildPolicy::ONLY_RELEASE_CRT), debug_libs, debug_lib_info.value_or_exit(VCPKG_LINE_INFO), msg_sink); here. Drive-by bugfix: EMPTY_INCLUDE_FOLDER should not block CMAKE_HELPER_PORT from checking that the include folder is, in fact, empty. Drive-by bugfix: if (!violations.empty()) { msg_sink.println_warning(msgPortBugRestrictedHeaderPaths); print_paths(msg_sink, violations); msg_sink.println(msgPortBugRestrictedHeaderPaths); // <-- duplicate! return LintStatus::PROBLEM_DETECTED; } Drive-by bugfix: There were duplicate checks for the lib/cmake and debug/lib/cmake directories which even printed the same message; these have been merged. Drive-by bugfix: The existing copyright check emitted nonsense output that included full absolute paths like: warning: The software license must be available at ${CURRENT_PACKAGES_DIR}/share/cmdline/copyright. vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/D:/b/cmdline//LICENSE") since at least #1116 That check has been basically rewritten to use vcpkg_install_copyright if there's only one src directory, and otherwise give up and print them all Drive-by bugfix: Several of the outdated CRTs didn't have the debug versions listed. Also, P was duplicated and there was no R for VC6.
- Loading branch information
1 parent
1e08aaa
commit 8014d4b
Showing
71 changed files
with
3,265 additions
and
875 deletions.
There are no files selected for viewing
77 changes: 66 additions & 11 deletions
77
azure-pipelines/e2e-assets/test-dll-port-template/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 |
---|---|---|
@@ -1,14 +1,69 @@ | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/test.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") | ||
|
||
if("release-only" IN_LIST FEATURES AND NOT "bad-release-only" IN_LIST FEATURES) | ||
set(VCPKG_BUILD_TYPE release) | ||
endif() | ||
|
||
if(NOT "install-no-lib-release" IN_LIST FEATURES AND NOT "debug-only" IN_LIST FEATURES) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
endif() | ||
|
||
if(NOT "install-no-lib-debug" IN_LIST FEATURES AND NOT "release-only" IN_LIST FEATURES) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
endif() | ||
|
||
if("install-to-lib" IN_LIST FEATURES) | ||
if(NOT "debug-only" IN_LIST FEATURES) | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
endif() | ||
if(NOT "release-only" IN_LIST FEATURES) | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
endif() | ||
else() | ||
if(NOT "debug-only" IN_LIST FEATURES) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") | ||
endif() | ||
if(NOT "release-only" IN_LIST FEATURES) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
endif() | ||
endif() | ||
|
||
if("extra-debug" IN_LIST FEATURES) | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" RENAME "test_dll2.lib") | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin" RENAME "test_dll2.dll") | ||
endif() | ||
|
||
if("extra-release" IN_LIST FEATURES) | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" RENAME "test_dll2.lib") | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin" RENAME "test_dll2.dll") | ||
endif() | ||
|
||
if("policy-skip-architecture-check" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled) | ||
endif() | ||
if("policy-skip-appcontainer-check" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_SKIP_APPCONTAINER_CHECK enabled) | ||
endif() | ||
if("policy-allow-dlls-in-lib" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_ALLOW_DLLS_IN_LIB enabled) | ||
endif() | ||
if("policy-allow-kernel32-from-xbox" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_ALLOW_KERNEL32_FROM_XBOX enabled) | ||
endif() | ||
if("policy-dlls-in-static-library" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled) | ||
endif() | ||
if("policy-mismatched-number-of-binaries" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES enabled) | ||
endif() | ||
if("policy-dlls-without-libs" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) | ||
endif() |
57 changes: 56 additions & 1 deletion
57
azure-pipelines/e2e-assets/test-dll-port-template/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 |
---|---|---|
@@ -1,4 +1,59 @@ | ||
{ | ||
"name": "test-dll", | ||
"version": "1.0.0" | ||
"version": "1.0.0", | ||
"features": { | ||
"bad-release-only": { | ||
"description": "Install only the release versions, but don't set the build type", | ||
"dependencies": [ | ||
{ | ||
"name": "test-dll", | ||
"features": [ | ||
"release-only" | ||
] | ||
} | ||
] | ||
}, | ||
"debug-only": { | ||
"description": "Install only the debug versions" | ||
}, | ||
"extra-debug": { | ||
"description": "Install an extra debug DLL" | ||
}, | ||
"extra-release": { | ||
"description": "Install an extra release DLL" | ||
}, | ||
"install-to-lib": { | ||
"description": "Incorrectly install the DLL to lib instead of bin" | ||
}, | ||
"install-no-lib-debug": { | ||
"description": "Incorrectly install no import lib for debug only" | ||
}, | ||
"install-no-lib-release": { | ||
"description": "Incorrectly install no import lib for release only" | ||
}, | ||
"policy-allow-dlls-in-lib": { | ||
"description": "Turn on VCPKG_POLICY_ALLOW_DLLS_IN_LIB" | ||
}, | ||
"policy-allow-kernel32-from-xbox": { | ||
"description": "Turn on VCPKG_POLICY_ALLOW_KERNEL32_FROM_XBOX" | ||
}, | ||
"policy-dlls-in-static-library": { | ||
"description": "Turn on VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY" | ||
}, | ||
"policy-skip-appcontainer-check": { | ||
"description": "Turn on VCPKG_POLICY_SKIP_APPCONTAINER_CHECK" | ||
}, | ||
"policy-skip-architecture-check": { | ||
"description": "Turn on VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK" | ||
}, | ||
"policy-mismatched-number-of-binaries": { | ||
"description": "Turn on VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES" | ||
}, | ||
"policy-dlls-without-libs": { | ||
"description": "Turn on VCPKG_POLICY_DLLS_WITHOUT_LIBS" | ||
}, | ||
"release-only": { | ||
"description": "Install only the release versions" | ||
} | ||
} | ||
} |
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,4 @@ | ||
mkdir "%~dp0debug" | ||
mkdir "%~dp0release" | ||
cl /MDd "%~dp0test.c" /Fo"%~dp0debug\test.obj" /Fe"%~dp0debug\test_exe.exe" | ||
cl /MD "%~dp0test.c" /Fo"%~dp0release\test.obj" /Fe"%~dp0release\test_exe.exe" |
17 changes: 17 additions & 0 deletions
17
azure-pipelines/e2e-assets/test-exe-port-template/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,17 @@ | ||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") | ||
|
||
if("release-only" IN_LIST FEATURES) | ||
set(VCPKG_BUILD_TYPE release) | ||
else() | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_exe.exe" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
endif() | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_exe.exe" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") | ||
|
||
if("policy-allow-exes-in-bin" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_ALLOW_EXES_IN_BIN enabled) | ||
endif() |
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,7 @@ | ||
#include <stdio.h> | ||
|
||
int main() | ||
{ | ||
puts("hello world"); | ||
return 0; | ||
} |
12 changes: 12 additions & 0 deletions
12
azure-pipelines/e2e-assets/test-exe-port-template/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,12 @@ | ||
{ | ||
"name": "test-exe", | ||
"version": "1.0.0", | ||
"features": { | ||
"release-only": { | ||
"description": "Only install release binaries" | ||
}, | ||
"policy-allow-exes-in-bin": { | ||
"description": "Turn on VCPKG_POLICY_ALLOW_EXES_IN_BIN" | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
azure-pipelines/e2e-assets/test-lib-port-template-dynamic-crt-release-only/build.cmd
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,6 @@ | ||
mkdir "%~dp0debug" | ||
mkdir "%~dp0release" | ||
cl /c /DNDEBUG /MD "%~dp0test.c" /Fo"%~dp0debug\test.obj" | ||
lib "%~dp0debug\test.obj" /OUT:"%~dp0debug\test_lib.lib" | ||
cl /c /DNDEBUG /MD "%~dp0test.c" /Fo"%~dp0release\test.obj" | ||
lib "%~dp0release\test.obj" /OUT:"%~dp0release\test_lib.lib" |
16 changes: 16 additions & 0 deletions
16
azure-pipelines/e2e-assets/test-lib-port-template-dynamic-crt-release-only/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,16 @@ | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_lib.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_lib.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/test.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") | ||
file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") | ||
if("policy-skip-crt-linkage-check" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_SKIP_CRT_LINKAGE_CHECK enabled) | ||
endif() | ||
if("policy-only-release-crt" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_ONLY_RELEASE_CRT enabled) | ||
endif() |
6 changes: 6 additions & 0 deletions
6
azure-pipelines/e2e-assets/test-lib-port-template-dynamic-crt-release-only/test.c
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,6 @@ | ||
#include <stdio.h> | ||
|
||
int __cdecl test_fn() { | ||
puts("You called the static lib function!"); | ||
return 42; | ||
} |
1 change: 1 addition & 0 deletions
1
azure-pipelines/e2e-assets/test-lib-port-template-dynamic-crt-release-only/test.h
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 @@ | ||
int __cdecl test_fn(); |
12 changes: 12 additions & 0 deletions
12
azure-pipelines/e2e-assets/test-lib-port-template-dynamic-crt-release-only/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,12 @@ | ||
{ | ||
"name": "test-lib", | ||
"version": "1.0.0", | ||
"features": { | ||
"policy-skip-crt-linkage-check": { | ||
"description": "Turn on VCPKG_POLICY_SKIP_CRT_LINKAGE_CHECK" | ||
}, | ||
"policy-only-release-crt": { | ||
"description": "Turn on VCPKG_POLICY_ONLY_RELEASE_CRT" | ||
} | ||
} | ||
} |
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
7 changes: 6 additions & 1 deletion
7
azure-pipelines/e2e-assets/test-lib-port-template-dynamic-crt/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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"name": "test-lib", | ||
"version": "1.0.0" | ||
"version": "1.0.0", | ||
"features": { | ||
"policy-skip-crt-linkage-check": { | ||
"description": "Turn on VCPKG_POLICY_SKIP_CRT_LINKAGE_CHECK" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:: This must be run from a Visual Studio 2013 command prompt | ||
mkdir "%~dp0debug" | ||
mkdir "%~dp0release" | ||
cl /MDd "%~dp0test.c" "%~dp0test.def" /Fo"%~dp0debug\test.obj" /Fe"%~dp0debug\test_dll.dll" /link /DLL | ||
cl /MD "%~dp0test.c" "%~dp0test.def" /Fo"%~dp0release\test.obj" /Fe"%~dp0release\test_dll.dll" /link /DLL |
Binary file not shown.
Binary file not shown.
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 @@ | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "MIT License.") | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include/vcpkg-msvc-2013") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/test.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/vcpkg-msvc-2013") | ||
|
||
if("release-only" IN_LIST FEATURES) | ||
set(VCPKG_BUILD_TYPE "release") | ||
else() | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/debug/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") | ||
endif() | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") | ||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/release/test_dll.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
|
||
if("policy" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT enabled) | ||
endif() |
Binary file not shown.
Binary file not shown.
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,17 @@ | ||
#include <windows.h> | ||
#include <stdio.h> | ||
|
||
BOOLEAN WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) | ||
{ | ||
(void)Reserved; | ||
if (nReason == DLL_PROCESS_ATTACH) { | ||
DisableThreadLibraryCalls( hDllHandle ); | ||
} | ||
|
||
return TRUE; | ||
} | ||
|
||
int __cdecl export_me() { | ||
puts("You called the exported function!"); | ||
return 42; | ||
} |
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,4 @@ | ||
LIBRARY test_dll | ||
|
||
EXPORTS | ||
export_me |
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 @@ | ||
// empty test header |
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,12 @@ | ||
{ | ||
"name": "vcpkg-msvc-2013", | ||
"version": "1", | ||
"features": { | ||
"policy": { | ||
"description": "Set VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT" | ||
}, | ||
"release-only": { | ||
"description": "Only install the release DLL" | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
azure-pipelines/e2e-ports/vcpkg-policy-absolute-paths/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,27 @@ | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "N/A") | ||
|
||
set(PROBLEM_TEXT "") | ||
if("build-dir" IN_LIST FEATURES) | ||
string(APPEND PROBLEM_TEXT "build-dir: ${CURRENT_BUILDTREES_DIR}\n") | ||
endif() | ||
if("downloads" IN_LIST FEATURES) | ||
string(APPEND PROBLEM_TEXT "downloads: ${DOWNLOADS}\n") | ||
endif() | ||
if("installed-root" IN_LIST FEATURES) | ||
string(APPEND PROBLEM_TEXT "installed-root: ${CURRENT_INSTALLED_DIR}\n") | ||
endif() | ||
if("package-dir" IN_LIST FEATURES) | ||
string(APPEND PROBLEM_TEXT "package-dir: ${CURRENT_PACKAGES_DIR}\n") | ||
endif() | ||
if("pkgconfig" IN_LIST FEATURES) | ||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/pkgconfig") | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/share/pkgconfig/vcpkg-policy-absolute-paths.pc" "${PROBLEM_TEXT}") | ||
endif() | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include") | ||
file(WRITE "${CURRENT_PACKAGES_DIR}/include/vcpkg-policy-absolute-paths.h" "${PROBLEM_TEXT}") | ||
|
||
if("policy" IN_LIST FEATURES) | ||
set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled) | ||
endif() |
24 changes: 24 additions & 0 deletions
24
azure-pipelines/e2e-ports/vcpkg-policy-absolute-paths/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,24 @@ | ||
{ | ||
"name": "vcpkg-policy-absolute-paths", | ||
"version": "1", | ||
"features": { | ||
"build-dir": { | ||
"description": "write CURRENT_BUILDTREES_DIR into the file" | ||
}, | ||
"downloads": { | ||
"description": "write DOWNLOADS into the file" | ||
}, | ||
"installed-root": { | ||
"description": "write CURRENT_INSTALLED_DIR into the file" | ||
}, | ||
"package-dir": { | ||
"description": "write CURRENT_PACKAGES_DIR into the file" | ||
}, | ||
"pkgconfig": { | ||
"description": "also add a pkgconfig file" | ||
}, | ||
"policy": { | ||
"description": "turn on VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK" | ||
} | ||
} | ||
} |
Oops, something went wrong.