Skip to content

Conversation

@externl
Copy link
Member

@externl externl commented Feb 28, 2025

This PR adds several improvements for the CMake builds on Windows.

  • Add support for TARGET_RUNTIME_DLLS generator expressions. This required some restructuring to tell cmake about the dlls and the libs. Now we can configure cmake to copy a target dependencies next to the target post build. No need for users to add a random NuGet dir to their PATH.
  • The unzipped Ice nuget is pretty big. Instead of a per config "cmake build folder" copy of the nuget, we now keep (git ignored) a shared one in cpp/cmake/packages

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer need this!

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.21)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TARGET_RUNTIME_DLLS is a 3.21 feature.

set(Ice_SOURCE_BUILD ON)
endif()

if(Ice_SOURCE_BUILD)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other languages we are no longer supporting to use the source build.


if (WIN32)
set(Ice_NUGET_NAME "zeroc.ice.v143")
set(Ice_NUGET_DIR "${CMAKE_CURRENT_LIST_DIR}/packages/${Ice_NUGET_NAME}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guessing that I can use a custom NuGet build by just installing it to this location, which would skip the install below.

list(APPEND ice_lib_path_suffixes_release "cpp/lib")
list(APPEND ice_lib_path_suffixes "cpp/lib")

if (Ice_ARCHITECTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is Ice_ARCHITECTURE and when is it not-set?

Copy link
Member Author

@externl externl Mar 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's computed from a few values (see above).

  • If CMAKE_LIBRARY_ARCHITECTURE is set we use it. For example this is set on Ubuntu to something like "x86_64-linux-gnu"
  • Otherwise if not set and we're on Windows we'll set it to either x64 or Win32

It's fine if it's not set. It's a matter of checking lib vs lib/<arch>. For instance it's not set on macOS.

@externl externl merged commit 42e6096 into zeroc-ice:main Mar 3, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants