Source

nsis64 / Contrib / ExDLL / SConscript

Full commit
gol...@212acab6-… 205abbe 









































































# FIXME: install assembly and pascal includes into the correct locations

lib_target = "pluginapi"

lib_files = Split("""
	pluginapi.c
""")

api_files = Split("""
	pluginapi.h
	nsis_tchar.h
	#Source/exehead/api.h
""")

example = Split("""
	exdll.c
	exdll.dpr
	exdll.dsp
	exdll.dsw
	exdll_with_unit.dpr
	exdll-vs2008.sln
	exdll-vs2008.vcproj
	nsis.pas
	extdll.inc
""")

Import('env plugin_env plugin_uenv')

unicodetarget = 'UNICODE' in env['CPPDEFINES']
lib_targetT = lib_target

# build library
if unicodetarget:
	lib_targetT = lib_targetT + 'W'
	api_uenv = plugin_uenv.Clone()
	api_uenv.Append(CPPPATH = ['#Source/exehead'])
	libW = api_uenv.Library(lib_targetT, lib_files)
	lib = libW
else:
	api_env = plugin_env.Clone()
	api_env.Append(CPPPATH = ['#Source/exehead'])
	libA = api_env.Library(lib_targetT, lib_files)
	lib = libA

# distribute library, files and examples

if env['PLATFORM'] == 'win32':
	env.DistributeExamples(lib, path='Plugin/nsis')

else:
	example += lib_files

	if env.has_key('PREFIX_PLUGINAPI_INC'):
		env.Distribute(api_files, None, 'pluginapi_inc', '', 'nsis', 'pluginapi', 'pluginapi')

	if env.has_key('PREFIX_PLUGINAPI_LIB'):
		env.Distribute(lib, None, 'pluginapi_lib', '', 'nsis', 'pluginapi', 'pluginapi')

if not unicodetarget:
	env.DistributeExamples(api_files, path='Plugin/nsis')
	env.DistributeExamples(example, path='Plugin')

# make sure all the other plug-ins can use the library

if unicodetarget:
	envT = plugin_uenv
	env.Install('#$BUILD_PREFIX/api/nsis', libW)
else:
	envT = plugin_env
	env.Install('#$BUILD_PREFIX/api/nsis', api_files + libA)

envT.Append(CPPPATH = ['#$BUILD_PREFIX/api'])
envT.Append(LIBPATH = ['#$BUILD_PREFIX/api/nsis'])
envT.Append(LIBS = [lib_targetT])