diff --git a/SCsub b/SCsub index edce52c..32cee66 100644 --- a/SCsub +++ b/SCsub @@ -121,5 +121,15 @@ if module_env.pmlpp_build_tests and module_env.pmlpp_build_old_classes: "test/mlpp_tests_old.cpp", ] -module_env.add_source_files(env.modules_sources, sources) +if ARGUMENTS.get('pmlpp_shared', 'no') == 'yes': + # Shared lib compilation + module_env.Append(CCFLAGS=['-fPIC']) + module_env['LIBS'] = [] + shared_lib = module_env.SharedLibrary(target='#bin/pmlpp', source=sources) + shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] + env.Append(LIBS=[shared_lib_shim]) + env.Append(LIBPATH=['#bin']) +else: + # Static compilation + module_env.add_source_files(env.modules_sources, sources)