premake-core icon indicating copy to clipboard operation
premake-core copied to clipboard

`NoCopyLocal` flag not working on Visual Studio 2022?

Open peter1745 opened this issue 3 years ago • 0 comments

So I'm trying to add the `NoCopyLocal´ flag to one of my premake scripts to stop Visual Studio from copying referenced C# assemblies to the target directory, but it doesn't seem to be working.

I have this premake script:

project "Sandbox"
	location "Assets/Scripts"
	kind "SharedLib"
	language "C#"
	dotnetframework "4.7.2"

	targetname "Sandbox"
	targetdir ("%{prj.location}/Binaries")
	objdir ("%{prj.location}/Intermediates")

	files 
	{
		"Assets/Scripts/Source/**.cs", 
	}

	linkAppReferences()

        flags { "NoCopyLocal" }

	filter "configurations:Debug"
		optimize "Off"
		symbols "Default"

	filter "configurations:Release"
		optimize "On"
		symbols "Default"

	filter "configurations:Dist"
		optimize "Full"
		symbols "Off"

and I'm linking / referencing some System assemblies by calling the linkAppReferences function which simply adds the necessary filepath to libdirs and then goes through and adds the assemblies to links.

I do realize it's possible that NoCopyLocal only applies to actual C# projects and not all referenced assemblies, but according to https://premake.github.io/docs/copylocal/#examples it should stop any assemblies being copied.

I'm really unsure why this isn't working.

What have you tried so far? I've tried moving the flag around in the script to see if that changed anything, I tried adding it on the workspace level, and nothing changed.

What version of Premake are you using? premake5 (Premake Build Script Generator) 5.0.0-dev (up to date with master)

peter1745 avatar Jul 28 '22 09:07 peter1745