Fixes to library loading and test sources.

This commit is contained in:
Christoffer Lerno
2024-08-11 16:46:53 +02:00
parent 7d643942b4
commit e67586b8b0
3 changed files with 4 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
#include "../version.h"
#include "../utils/lib.h"
#include <stdint.h>
#define MAX_BUILD_LIB_DIRS 1024
#define MAX_COMMAND_LINE_FILES 2048
@@ -617,7 +618,7 @@ typedef struct
} BuildTarget;
static const char *x86_cpu_set[8] = {
[X86CPU_BASELINE] = "baseline",
[X86CPU_BASELINE] = "baseline", // NOLINT
[X86CPU_SSSE3] = "ssse3",
[X86CPU_SSE4] = "sse4",
[X86CPU_AVX1] = "avx1",

View File

@@ -71,8 +71,7 @@ static inline void parse_library_type(Library *library, LibraryTarget ***target_
static inline void parse_library_target(Library *library, LibraryTarget *target, const char *target_name,
JSONObject *object)
{
target->link_flags = target->link_flags = get_string_array(library->dir, target_name, object, "link-args", false);
target->link_flags = get_string_array(library->dir, target_name, object, "link-args", false);
if (!target->link_flags)
{
target->link_flags = get_string_array(library->dir, target_name, object, "linkflags", false);

View File

@@ -1072,7 +1072,7 @@ void compile()
{
symtab_init(compiler.build.symtab_size);
compiler.build.sources = target_expand_source_names(NULL, compiler.build.source_dirs, c3_suffix_list, 3, true);
if (compiler.build.testing)
if (compiler.build.testing && compiler.build.test_source_dirs)
{
const char **test_sources = target_expand_source_names(NULL, compiler.build.test_source_dirs, c3_suffix_list, 3, true);
FOREACH(const char *, file, test_sources) vec_add(compiler.build.sources, file);