@@ -1285,6 +1285,9 @@ int CMakePrinter::generate(const BuildSettings &bs) const
12851285 c.buf_size = 256 ; // for frequent flushes
12861286 auto ret = run_command (s, c);
12871287
1288+ if (fs::exists (bs.binary_directory / CPPAN_CONFIG_FILENAME))
1289+ bs.config_fullname = read_file (bs.binary_directory / CPPAN_CONFIG_FILENAME);
1290+
12881291 if (bs.allow_links )
12891292 {
12901293 if (!s.silent || s.is_custom_build_dir ())
@@ -2108,7 +2111,9 @@ endif()
21082111 ctx.increaseIndent (" target_compile_definitions (${this}" );
21092112 if (!d.flags [pfHeaderOnly])
21102113 {
2111- ctx.addLine (" PRIVATE ${LIBRARY_API}" s + (d.flags [pfExecutable] ? " " : " =${CPPAN_EXPORT}" ));
2114+ // ?
2115+ // ctx.addLine("PRIVATE ${LIBRARY_API}"s + (d.flags[pfExecutable] ? "" : "=${CPPAN_EXPORT}"));
2116+ ctx.addLine (" PRIVATE ${LIBRARY_API}=${CPPAN_EXPORT}" );
21122117 if (!d.flags [pfExecutable])
21132118 ctx.addLine (" INTERFACE ${LIBRARY_API}=${CPPAN_IMPORT}" );
21142119 }
@@ -2301,7 +2306,15 @@ endif()
23012306 // CPPAN_CONFIG is private for a package!
23022307 ctx.addLine (" PRIVATE CPPAN_CONFIG=\" ${config}\" " );
23032308 }
2304- for (auto &a : p.api_name )
2309+ auto api_names = p.api_name ;
2310+ if (!p.skip_default_api )
2311+ {
2312+ auto pp = p.pkg .ppath ;
2313+ while (!pp.empty () && pp.front () != p.default_api_start )
2314+ pp = pp.slice (1 );
2315+ api_names.insert (boost::to_upper_copy (!pp.empty () ? pp.toString (" _" ) : p.pkg .ppath .back ()) + " _API" );
2316+ }
2317+ for (auto &a : api_names)
23052318 ctx.addLine (visibility + " " + a + " =${LIBRARY_API}" );
23062319 ctx.decreaseIndent (" )" );
23072320 ctx.addLine ();
0 commit comments