On Wed, Jun 12, 2024 at 5:37 AM Timofey Zhakov <[email protected]> wrote:
> > 2.
> > gen-make.py accepts --with-PKG=... options like the following, but all
> > options should be passed to cmake -B again. Why CMakeLists.txt is
> > generated instead of adding directly CMakeLists.txt, in the patch?
>
> That's a good question. I decided to just generate the CMake files
> based on build.conf. I think this approach is great because we can
> keep vcnet project files and Unix Makefiles until the CMake can fully
> replace them. The dependency searching is delegated to the CMake, so
> the CMakeLists.txt file can be generated from the release.py script
> and put into release tar-ball like 'configure', because it would not
> contain any paths and options. Additionally, we can also someday just
> simply put the generated CMakeLists.txt file into the repository,
> cut-off the gen-make build system, and use CMake as the main build
> system.
Thanks for the explanation. That makes sense. Adding CMakeLists.txt file
to release tarball seems to be good to me.
> 1. You don't need to pass the options to the gen-make command, because
> the dependency searching is done via CMake, so the options are ignored.
> 2. Instead of specifying each include dir and library path, you could
> just specify the CMAKE_INSTALL_PREFIX variable to a path where the
> dependencies are installed.
I try to use CMAKE_INSTALL_PREFIX variable. However, I think CMakeLists.txt
should have all options corresponding to the --with-PKG of gen-make.py.
Just tried with the following commands:
[[[
cmake.exe ^
-B "C:/usr/src/subversion/trunk-py312/out" ^
-D CMAKE_BUILD_TYPE=Release ^
-D CMAKE_PREFIX_PATH=C:/usr/apps/vcpkg/installed/x64-windows-release ^
-D BUILD_SHARED_LIBS=ON ^
-D SVN_SQLITE_USE_AMALGAMATION=OFF ^
-D SVN_USE_INTERNAL_LZ4=ON ^
-D SVN_USE_INTERNAL_UTF8PROC=ON ^
-D APR_INCLUDE_DIR=C:/usr/src/subversion/win64-vs16/httpd/include ^
-D APR_LIBRARY=C:/usr/src/subversion/win64-vs16/httpd/lib/libapr-1.lib ^
-D APRUTIL_INCLUDE_DIR=C:/usr/src/subversion/win64-vs16/httpd/include ^
-D APRUTIL_LIBRARY=C:/usr/src/subversion/win64-vs16/httpd/lib/libaprutil-1.lib
^
-D SQLite3_INCLUDE_DIR=C:/usr/apps/vcpkg/installed/x64-windows-static/include
^
-D
SQLite3_LIBRARY=C:/usr/apps/vcpkg/installed/x64-windows-static/lib/sqlite3.lib
^
|| exit/b 1
cmake.exe ^
--build "C:/usr/src/subversion/trunk-py312/out" ^
--config Release ^
--parallel --verbose ^
-- ^
-clp:ShowCommandLine -fl -flp:logfile=msbuild.log ^
|| exit/b 1
]]
But I encountered many "unresolved external symbol __imp_htonl" errors.
[[[
6>checksum.obj : error LNK2019: unresolved external symbol
__imp_htonl referenced in function close_handler
[C:\usr\src\subversion\trunk-py312\out\libsvn_subr.vcxproj]
]]]
It seems to be caused by missing ws2_32.lib for the linking. I guess
`gen_cmake.py` needs methods like `get_static_win_depends` and
`get_linked_win_depends` in `gen_win.py`? Have you got success to
build on your Windows environment with cmake?
--
Jun Omae <[email protected]> (大前 潤)