Skip to content

Commit

Permalink
[tests] Improve test Makefile when specifying runtime identifier on t…
Browse files Browse the repository at this point in the history
…he command line. (#21169)

Using RUNTIMEIDENTIFIER(S) in the Makefile interferes with the build, because
they get passed on to msbuild, which sees them as properties (RuntimeIdentifier(s)).

Thus use RID instead, and only pass on the value to the build if appropriate.
  • Loading branch information
rolfbjarne committed Sep 4, 2024
1 parent a6b5d22 commit a854ebe
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions tests/common/shared-dotnet.mk
Original file line number Diff line number Diff line change
Expand Up @@ -72,44 +72,50 @@ ifeq ($(PLATFORM),)
PLATFORM=$(shell basename "$(CURDIR)")
endif

ifeq ($(RUNTIMEIDENTIFIERS),)
ifneq ($(RUNTIMEIDENTIFIERS)$(RUNTIMEIDENTIFIER),)
$(error "Don't set RUNTIMEIDENTIFIER or RUNTIMEIDENTIFIERS, set RID instead")
endif

ifeq ($(RID),)
ifeq ($(PLATFORM),iOS)
RUNTIMEIDENTIFIERS=ios-arm64
RID=ios-arm64
else ifeq ($(PLATFORM),tvOS)
RUNTIMEIDENTIFIERS=tvos-arm64
RID=tvos-arm64
else ifeq ($(PLATFORM),MacCatalyst)
ifeq ($(CONFIG),Release)
RUNTIMEIDENTIFIERS=maccatalyst-x64;maccatalyst-arm64
RID=maccatalyst-x64;maccatalyst-arm64
else ifneq ($(UNIVERSAL),)
RUNTIMEIDENTIFIERS=maccatalyst-x64;maccatalyst-arm64
RID=maccatalyst-x64;maccatalyst-arm64
else ifeq ($(shell arch),arm64)
RUNTIMEIDENTIFIERS=maccatalyst-arm64
RID=maccatalyst-arm64
else
RUNTIMEIDENTIFIERS=maccatalyst-x64
RID=maccatalyst-x64
endif
else ifeq ($(PLATFORM),macOS)
ifeq ($(CONFIG),Release)
RUNTIMEIDENTIFIERS=osx-x64;osx-arm64
RID=osx-x64;osx-arm64
else ifneq ($(UNIVERSAL),)
RUNTIMEIDENTIFIERS=osx-x64;osx-arm64
RID=osx-x64;osx-arm64
else ifeq ($(shell arch),arm64)
RUNTIMEIDENTIFIERS=osx-arm64
RID=osx-arm64
else
RUNTIMEIDENTIFIERS=osx-x64
RID=osx-x64
endif
else
RUNTIMEIDENTIFIERS=unknown-platform-$(PLATFORM)
RID=unknown-platform-$(PLATFORM)
endif
endif

ifneq ($(UNIVERSAL),)
UNIVERSAL_ARGUMENT=/p:UniversalBuild=true
endif

ifeq ($(findstring ;,$(RUNTIMEIDENTIFIERS)),;)
ifeq ($(findstring ;,$(RID)),;)
PATH_RID=
export RUNTIMEIDENTIFIERS=$(RID)
else
PATH_RID=$(RUNTIMEIDENTIFIERS)/
PATH_RID=$(RID)/
export RUNTIMEIDENTIFIER=$(RID)
endif


Expand Down

8 comments on commit a854ebe

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.