-
Notifications
You must be signed in to change notification settings - Fork 58
Updating mstelemetry portfile for windows #810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3eb7c1a
Updating mstelemetry portfile for windows
ea7e3d3
Merge branch 'master' into win-vcpkg-port
maxgolov f407a61
Merge branch 'master' into win-vcpkg-port
maxgolov 350cf5b
Merge branch 'master' into win-vcpkg-port
maxgolov 39e2ea1
Merge branch 'master' into win-vcpkg-port
maxgolov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,45 +4,80 @@ message("CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}") | |
| message("CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}") | ||
| message("CMAKE_CURRENT_LIST_DIR=${CMAKE_CURRENT_LIST_DIR}") | ||
|
|
||
| execute_process(COMMAND "${CMAKE_CURRENT_LIST_DIR}/get_repo_name.sh" OUTPUT_VARIABLE REPO_NAME ERROR_QUIET) | ||
| if (UNIX) | ||
| execute_process(COMMAND "${CMAKE_CURRENT_LIST_DIR}/get_repo_name.sh" OUTPUT_VARIABLE REPO_NAME ERROR_QUIET) | ||
| else() | ||
| # execute_process(COMMAND git config --get remote.origin.url OUTPUT_VARIABLE REPO_URL ERROR_QUIET) | ||
| # message("REPO_URL=${REPO_URL}") | ||
| # string(REPLACE "/" ";" REPO_URL_LIST ${REPO_URL}) | ||
| # message(REPO_URL_LIST "list = ${REPO_URL_LIST}") | ||
| # list(LENGTH ${REPO_URL_LIST} LAST_ITEM) | ||
| # list(GET ${REPO_URL_LIST} ${LAST_ITEM} REPO_NAME) | ||
| endif() | ||
|
|
||
| message("REPO_NAME=${REPO_NAME}") | ||
|
|
||
| if (DEFINED REPO_NAME) | ||
| # Use local snapshot since we already cloned the code | ||
| get_filename_component(SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) | ||
| message("Using local source snapshot from ${SOURCE_PATH}") | ||
| # Use local snapshot since we already cloned the code | ||
| get_filename_component(SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) | ||
| message("Using local source snapshot from ${SOURCE_PATH}") | ||
| else() | ||
| # Fetch from GitHub master | ||
| message("Fetching source code from GitHub...") | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO microsoft/cpp_client_telemetry | ||
| HEAD_REF master | ||
| ) | ||
| # Fetch from GitHub master | ||
| message("Fetching source code from GitHub...") | ||
| if (UNIX) | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO microsoft/cpp_client_telemetry | ||
| HEAD_REF master | ||
| ) | ||
| else() | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO microsoft/cpp_client_telemetry | ||
| REF 4f60dd3bca305c2c0dd5ec2ed7b91d36b4de6dcf | ||
| SHA512 9778df5aa65d95fe1d41739753495d29b3149676e98ac2e802a103604553f4f2b43bc2eb089c2e13dc695f70279287ea79ec6e2926fad03befe8a671f91d36fb | ||
| HEAD_REF master | ||
| PATCHES ${CMAKE_CURRENT_LIST_DIR}/v142-build.patch | ||
| ) | ||
| endif() | ||
| endif() | ||
|
|
||
| # TODO: it will be slightly cleaner to perform pure CMake or Ninja build, by describing all possible variable options | ||
| # as separate triplets. Since we have a fairly non-trivial build logic in build.sh script - we use it as-is for now. | ||
| # build.sh itself should check if we are building under vcpkg and avoid installing deps that are coming from vcpkg. | ||
| if (UNIX) | ||
| vcpkg_execute_build_process( | ||
| COMMAND ${SOURCE_PATH}/build.sh noroot | ||
| WORKING_DIRECTORY ${SOURCE_PATH}/ | ||
| LOGNAME build | ||
| ) | ||
|
|
||
| vcpkg_execute_build_process( | ||
| COMMAND ${SOURCE_PATH}/install.sh ${CURRENT_PACKAGES_DIR} | ||
| WORKING_DIRECTORY ${SOURCE_PATH}/ | ||
| LOGNAME install | ||
| ) | ||
| vcpkg_execute_build_process( | ||
| COMMAND ${SOURCE_PATH}/build.sh noroot | ||
| WORKING_DIRECTORY ${SOURCE_PATH}/ | ||
| LOGNAME build | ||
| ) | ||
|
|
||
| vcpkg_execute_build_process( | ||
| COMMAND ${SOURCE_PATH}/install.sh ${CURRENT_PACKAGES_DIR} | ||
| WORKING_DIRECTORY ${SOURCE_PATH}/ | ||
| LOGNAME install | ||
| ) | ||
|
|
||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
| else() | ||
| # TODO: verify Windows build | ||
| vcpkg_execute_build_process( | ||
| COMMAND ${SOURCE_PATH}/build-all.bat | ||
| WORKING_DIRECTORY ${SOURCE_PATH}/ | ||
| LOGNAME build | ||
| ) | ||
| endif() | ||
| vcpkg_check_linkage(ONLY_STATIC_LIBRARY) | ||
|
|
||
| file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
| vcpkg_install_msbuild( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PROJECT_SUBPATH Solutions/MSTelemetrySDK.sln | ||
| LICENSE_SUBPATH LICENSE | ||
| RELEASE_CONFIGURATION Release | ||
| DEBUG_CONFIGURATION Debug | ||
| OPTIONS /p:MATSDK_SHARED_LIB=1 | ||
| PLATFORM ${VCPKG_TARGET_ARCHITECTURE} | ||
| PLATFORM_TOOLSET v142 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can add two options here:
In general, maybe just replacing it with a custom variable logic - if set, use the value from var; else if not set, then assume the tool chain is v142 - would be good enough at first. |
||
| TARGET sqlite,win32-lib | ||
| USE_VCPKG_INTEGRATION | ||
| ) | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
| file(COPY "${SOURCE_PATH}/lib/include/public" DESTINATION "${CURRENT_PACKAGES_DIR}") | ||
| file(RENAME "${CURRENT_PACKAGES_DIR}/public" "${CURRENT_PACKAGES_DIR}/include") | ||
| file(COPY "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
| file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "Refer to LICENSE file") | ||
| endif() | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add a batch file
get_repo_name.cmdhere, but we also then need to assume thatgit.exeis also in the path.