-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[vcpkg-make] Add new port #39050
base: master
Are you sure you want to change the base?
[vcpkg-make] Add new port #39050
Conversation
…vcpkg-make # Conflicts: # ports/vcpkg-make/vcpkg-make-common.cmake # ports/vcpkg-make/vcpkg-make.cmake
Please drop a note when this is "ready for review". |
This is ready for review. |
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.
Submitting at 12 comments, slightly tired. Need to review my review later.
My old test-related comments still seem to apply.
@@ -195,6 +195,7 @@ foreach(flag ${VCPKG_LANGUAGES} SHARED_LINKER EXE_LINKER STATIC_LINKER MODULE_LI | |||
endif() | |||
endif() | |||
endif() | |||
string(STRIP "${${flag}_FLAGS}" "${flag}_FLAGS") |
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.
This is the only change to this port. Is it necessary?
(The original flags may always having leading or trailing space.)
vcpkg_download_distfile(ARCHIVE | ||
URLS https://ftp.gnu.org/gnu/automake/automake-1.17.tar.gz | ||
FILENAME automake.tar.gz | ||
SHA512 11357dfab8cbf4b5d94d9d06e475732ca01df82bef1284888a34bd558afc37b1a239bed1b5eb18a9dbcc326344fb7b1b301f77bb8385131eb8e1e118b677883a | ||
) | ||
|
||
vcpkg_extract_source_archive( | ||
automake_source | ||
ARCHIVE ${ARCHIVE} | ||
) | ||
|
||
file(COPY | ||
"${CMAKE_CURRENT_LIST_DIR}/" | ||
DESTINATION | ||
"${CURRENT_PACKAGES_DIR}/share/${PORT}" | ||
) | ||
|
||
file(COPY | ||
"${automake_source}/lib/ar-lib" | ||
"${automake_source}/lib/compile" | ||
DESTINATION | ||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/wrappers" | ||
) |
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.
IIUC these wrappers are only used for MSVC.
In that case, linux binaries should not need to rebuild for wrapper updates.
In that case, this should be decoupled into a separate port, to scope the dependency at least to windows & !mingw
.
file(REMOVE | ||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/portfile.cmake" | ||
"${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg.json" | ||
) |
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.
Prefering explicit copying over selective removal.
(General pattern in script ports.)
file(GLOB cmake_files "${CMAKE_CURRENT_LIST_DIR}/*.cmake") | ||
list(REMOVE_ITEM cmake_files "${CMAKE_CURRENT_LIST_FILE}") | ||
foreach(cmake_file IN LISTS cmake_files) | ||
include("${cmake_file}") | ||
endforeach() |
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.
Prefering explicit including over globbing with selective removal.
(General pattern in script ports.)
message(STATUS "Generating configure for ${TARGET_TRIPLET}") | ||
vcpkg_run_shell( | ||
SHELL ${shell_cmd} | ||
COMMAND ${AUTORECONF} -vfi |
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.
COMMAND ${AUTORECONF} -vfi | |
COMMAND "${AUTORECONF}" -vfi | |
# Restore environment | ||
vcpkg_restore_env_variables(VARS | ||
${cm_FLAGS} | ||
C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_LIBRARY_PATH | ||
INCLUDE LIB LIBPATH _CL_ _LINK_ | ||
) |
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.
The environment is not restored between release and debug. I hope debug settings are prepended correctly.
|
||
z_vcpkg_make_restore_env() | ||
|
||
vcpkg_restore_env_variables(VARS LIB LIBPATH LIBRARY_PATH) |
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.
OTOH, this restore takes place after each build type.
endfunction() | ||
|
||
function(z_vcpkg_make_prepare_link_flags) | ||
cmake_parse_arguments(PARSE_ARGV 0 ARG |
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.
cmake_parse_arguments(PARSE_ARGV 0 ARG | |
cmake_parse_arguments(PARSE_ARGV 0 arg |
etc.
function(z_vcpkg_make_prepare_link_flags) | ||
cmake_parse_arguments(PARSE_ARGV 0 ARG | ||
"" | ||
"IN_OUT_VAR;X_VCPKG_TRANSFORM_LIBS;VCPKG_TARGET_IS_WINDOWS;VCPKG_TARGET_IS_MINGW;VCPKG_LIBRARY_LINKAGE" |
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.
Confusing...
"IN_OUT_VAR;X_VCPKG_TRANSFORM_LIBS;VCPKG_TARGET_IS_WINDOWS;VCPKG_TARGET_IS_MINGW;VCPKG_LIBRARY_LINKAGE" | |
"IN_OUT_VAR;TRANSFORM_LIBS;TARGET_IS_WINDOWS;TARGET_IS_MINGW;LIBRARY_LINKAGE" |
... or maybe not use args at all. Calling sites, in particual tests, might override vars within block()
scopes.
|
||
set(link_flags ${${ARG_IN_OUT_VAR}}) | ||
|
||
if(ARG_X_VCPKG_TRANSFORM_LIBS STREQUAL "ON") |
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.
Literally ON
?
And why call it with OFF
at all?
Testing to see what happens when various options are on/off. Added a test port and cleaned up some of the code.