Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Adding Versioning to Native components in non-Windows builds. - #4393

Merged
joperezr merged 2 commits into
dotnet:masterfrom
joperezr:NativeNonWindowsVersion
Apr 21, 2016
Merged

joperezr merged 2 commits into
dotnet:masterfrom
joperezr:NativeNonWindowsVersion

Conversation

@joperezr

Copy link
Copy Markdown
Member

Adding Versioning to Native components in non-Windows builds.

cc: @weshaggard @gkhanna79

fixes: #3133

Comment thread build.cmd
:CollectMsbuildArgs
shift
if "%1"=="" goto ArgsDone
if /i [%1] == [/p:OfficialBuildId] (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As we chatted we want to do this as a separate step from the normal build flow so please make sure we track that work item.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Issue #4395 will track that.

@joperezr

Copy link
Copy Markdown
Member Author

cc: @ellismg

@janvorli

Copy link
Copy Markdown
Member

It seems we can make the change localized instead of making it distributed over many CMakeLists.txt files. Recent change from @rahku (you'll need to update your sources to get it) has introduced wrappers around add_executable and add_library where we can add the version sources in a centralized manner.

Comment thread CMakeLists.txt Outdated
set(CLR_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(VM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/vm)
set(GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/inc)
set(VERSION_FILE_PATH "${CMAKE_BINARY_DIR}/../version.c")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should generate the version file to the CMAKE_BINARY_DIR directly, not one level below. All generated files for a configuration (release, debug, ...) should be contained to the CMAKE_BINARY_DIR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

makes sense, I'll change this.

@joperezr

Copy link
Copy Markdown
Member Author

...has introduced wrappers around add_executable and add_library where we can add the version sources in a centralized manner.

I'm testing out the changes right now in my OSX and my Ubuntu box using Rahul's wrappers. If that passes then I'll rebase and update this PR. Thanks for the suggestion!

@joperezr
joperezr force-pushed the NativeNonWindowsVersion branch from e3c424e to 25b7a5d Compare April 20, 2016 21:30
@joperezr

Copy link
Copy Markdown
Member Author

@janvorli I have applied all of your feedback and now I'm using the centralized way to add this source file. Let me know if you have any more comments so that I can address them.

@rahku PTAL to see if the changes I made to the wrappers are what you expected.

Comment thread src/pal/src/CMakeLists.txt Outdated
)

add_library(coreclrpal
_add_library(coreclrpal

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This adds a static library, I don't think you want to add version to that, since this library gets linked into most of the shared libs. You would end up with the version stuff being twice in them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sounds good I'll remove it from there.

@janvorli

Copy link
Copy Markdown
Member

LGTM

@joperezr

Copy link
Copy Markdown
Member Author

Merging now since it looks like OSX CI machines are down, and I have validated in my own OSX box that the code works.

@joperezr
joperezr merged commit 250a206 into dotnet:master Apr 21, 2016
@joperezr
joperezr deleted the NativeNonWindowsVersion branch April 21, 2016 15:45
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…/coreclr#4393)

Adding Versioning to Native components in non-Windows builds.


Commit migrated from dotnet/coreclr@250a206
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embed version number information in native libraries

8 participants