khamake icon indicating copy to clipboard operation
khamake copied to clipboard

A library's addDefine gets ignored

Open XANOZOID opened this issue 6 years ago • 1 comments

Basically, I was able to test that my flags were being ignored when they were declared in an added library.

The library khafile.js

let project = new Project('tests');
project.addDefine('hxp_test_message_lib');

resolve(project);

The project khafile.js

let project = new Project('tests');
project.addDefine('hxp_test_message');
project.addLibrary('HaxePunk');
resolve(project);

Theoretical haxe file:

class App 
{

	public static function main() 
	{
		#if (hxp_test_message)
				trace("message from project");
		#end
		#if (hxp_test_message_lib)
				trace("message from lib");
		#end
		System.start({title: "Project", width: 1024, height: 768, framebuffer: {frequency: 60}}, function(window)
		{
			// . . .
		});
	}
}

The output ignores the library's define, but it registers the projects own flag.

XANOZOID avatar Aug 04 '19 00:08 XANOZOID

Correction, as clarified in the IRC I was using addLibrary incorrectly. addProject is the functionality I'm looking for, but it doesn't fallback to Haxelib projects - which I actually want. So I'll be making a pull-request that takes care of this use-case.

XANOZOID avatar Aug 04 '19 00:08 XANOZOID