Add support for object libraries

Closes #34
main
Duncan Ogilvie 3 years ago
parent 6a825e15a0
commit 2bcf15c4ed

@ -45,6 +45,7 @@ enum TargetType {
target_static, target_static,
target_interface, target_interface,
target_custom, target_custom,
target_object,
}; };
template <typename T> template <typename T>

@ -766,6 +766,12 @@ void generate_cmake(const char *path, const parser::Project *parent_project) {
target_type = "SOURCES"; target_type = "SOURCES";
target_scope = "PUBLIC"; target_scope = "PUBLIC";
break; break;
case parser::target_object:
// NOTE: This is properly supported since 3.12
add_command = "add_library";
target_type = "OBJECT";
target_scope = "PUBLIC";
break;
default: default:
assert("Unimplemented enum value" && false); assert("Unimplemented enum value" && false);
} }

@ -9,7 +9,7 @@
#include <tsl/ordered_set.h> #include <tsl/ordered_set.h>
template <> template <>
const char *enumStrings<cmkr::parser::TargetType>::data[] = {"executable", "library", "shared", "static", "interface", "custom"}; const char *enumStrings<cmkr::parser::TargetType>::data[] = {"executable", "library", "shared", "static", "interface", "custom", "object"};
namespace cmkr { namespace cmkr {
namespace parser { namespace parser {

Loading…
Cancel
Save