mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 07:46:21 +02:00
C API: Keep the structure flat
See https://github.com/NixOS/nix/pull/10329
This commit is contained in:
parent
d96b52bd8b
commit
c57de60522
26 changed files with 50 additions and 32 deletions
6
Makefile
6
Makefile
|
@ -18,9 +18,9 @@ makefiles = \
|
||||||
src/libexpr/local.mk \
|
src/libexpr/local.mk \
|
||||||
src/libcmd/local.mk \
|
src/libcmd/local.mk \
|
||||||
src/nix/local.mk \
|
src/nix/local.mk \
|
||||||
src/libutil/c/local.mk \
|
src/libutil-c/local.mk \
|
||||||
src/libstore/c/local.mk \
|
src/libstore-c/local.mk \
|
||||||
src/libexpr/c/local.mk \
|
src/libexpr-c/local.mk \
|
||||||
src/resolve-system-dependencies/local.mk \
|
src/resolve-system-dependencies/local.mk \
|
||||||
scripts/local.mk \
|
scripts/local.mk \
|
||||||
misc/bash/local.mk \
|
misc/bash/local.mk \
|
||||||
|
|
|
@ -36,9 +36,9 @@ GENERATE_LATEX = NO
|
||||||
# so they can expand variables despite configure variables.
|
# so they can expand variables despite configure variables.
|
||||||
|
|
||||||
INPUT = \
|
INPUT = \
|
||||||
src/libutil/c \
|
src/libutil-c \
|
||||||
src/libexpr/c \
|
src/libexpr-c \
|
||||||
src/libstore/c \
|
src/libstore-c \
|
||||||
doc/external-api/README.md
|
doc/external-api/README.md
|
||||||
|
|
||||||
FILE_PATTERNS = nix_api_*.h *.md
|
FILE_PATTERNS = nix_api_*.h *.md
|
||||||
|
|
2
local.mk
2
local.mk
|
@ -2,7 +2,7 @@ GLOBAL_CXXFLAGS += -Wno-deprecated-declarations -Werror=switch
|
||||||
# Allow switch-enum to be overridden for files that do not support it, usually because of dependency headers.
|
# Allow switch-enum to be overridden for files that do not support it, usually because of dependency headers.
|
||||||
ERROR_SWITCH_ENUM = -Werror=switch-enum
|
ERROR_SWITCH_ENUM = -Werror=switch-enum
|
||||||
|
|
||||||
$(foreach i, config.h $(wildcard src/lib*/*.hh) $(wildcard src/lib*/*.h $(filter-out %_internal.h, $(wildcard src/lib*/c/*.h))), \
|
$(foreach i, config.h $(wildcard src/lib*/*.hh) $(wildcard src/lib*/*.h $(filter-out %_internal.h, $(wildcard src/lib*c/*.h))), \
|
||||||
$(eval $(call install-file-in, $(i), $(includedir)/nix, 0644)))
|
$(eval $(call install-file-in, $(i), $(includedir)/nix, 0644)))
|
||||||
|
|
||||||
$(GCH): src/libutil/util.hh config.h
|
$(GCH): src/libutil/util.hh config.h
|
||||||
|
|
25
src/libexpr-c/local.mk
Normal file
25
src/libexpr-c/local.mk
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
libraries += libexprc
|
||||||
|
|
||||||
|
libexprc_NAME = libnixexprc
|
||||||
|
|
||||||
|
libexprc_DIR := $(d)
|
||||||
|
|
||||||
|
libexprc_SOURCES := \
|
||||||
|
$(wildcard $(d)/*.cc) \
|
||||||
|
|
||||||
|
# Not just for this library itself, but also for downstream libraries using this library
|
||||||
|
|
||||||
|
INCLUDE_libexprc := -I $(d)
|
||||||
|
libexprc_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libutilc) \
|
||||||
|
$(INCLUDE_libfetchers) \
|
||||||
|
$(INCLUDE_libstore) $(INCLUDE_libstorec) \
|
||||||
|
$(INCLUDE_libexpr) $(INCLUDE_libexprc)
|
||||||
|
|
||||||
|
libexprc_LIBS = libutil libutilc libstore libstorec libexpr
|
||||||
|
|
||||||
|
libexprc_LDFLAGS += -pthread
|
||||||
|
|
||||||
|
$(eval $(call install-file-in, $(d)/nix-expr-c.pc, $(libdir)/pkgconfig, 0644))
|
||||||
|
|
||||||
|
libexprc_FORCE_INSTALL := 1
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
libraries += libexprc
|
|
||||||
|
|
||||||
libexprc_NAME = libnixexprc
|
|
||||||
|
|
||||||
libexprc_DIR := $(d)
|
|
||||||
|
|
||||||
libexprc_SOURCES := \
|
|
||||||
$(wildcard $(d)/*.cc) \
|
|
||||||
|
|
||||||
libexprc_CXXFLAGS += -I src/libutil -Isrc/libfetchers -I src/libstore -I src/libstorec -I src/libexpr -I src/libutil/c -I src/libstore/c
|
|
||||||
|
|
||||||
libexprc_LIBS = libutil libutilc libstore libstorec libexpr
|
|
||||||
|
|
||||||
libexprc_LDFLAGS += -pthread
|
|
||||||
|
|
||||||
$(eval $(call install-file-in, $(d)/nix-expr-c.pc, $(libdir)/pkgconfig, 0644))
|
|
||||||
|
|
||||||
libexprc_FORCE_INSTALL := 1
|
|
||||||
|
|
|
@ -10,7 +10,11 @@ libstorec_LIBS = libutil libstore libutilc
|
||||||
|
|
||||||
libstorec_LDFLAGS += -pthread
|
libstorec_LDFLAGS += -pthread
|
||||||
|
|
||||||
libstorec_CXXFLAGS += -I src/libutil -I src/libstore -I src/libutil/c
|
# Not just for this library itself, but also for downstream libraries using this library
|
||||||
|
|
||||||
|
INCLUDE_libstorec := -I $(d)
|
||||||
|
libstorec_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libutilc) \
|
||||||
|
$(INCLUDE_libstore) $(INCLUDE_libstorec)
|
||||||
|
|
||||||
$(eval $(call install-file-in, $(d)/nix-store-c.pc, $(libdir)/pkgconfig, 0644))
|
$(eval $(call install-file-in, $(d)/nix-store-c.pc, $(libdir)/pkgconfig, 0644))
|
||||||
|
|
|
@ -6,7 +6,10 @@ libutilc_DIR := $(d)
|
||||||
|
|
||||||
libutilc_SOURCES := $(wildcard $(d)/*.cc)
|
libutilc_SOURCES := $(wildcard $(d)/*.cc)
|
||||||
|
|
||||||
libutilc_CXXFLAGS += -I src/libutil
|
# Not just for this library itself, but also for downstream libraries using this library
|
||||||
|
|
||||||
|
INCLUDE_libutilc := -I $(d)
|
||||||
|
libutilc_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libutilc)
|
||||||
|
|
||||||
libutilc_LIBS = libutil
|
libutilc_LIBS = libutil
|
||||||
|
|
|
@ -24,9 +24,12 @@ libexpr-tests_EXTRA_INCLUDES = \
|
||||||
-I tests/unit/libstore-support \
|
-I tests/unit/libstore-support \
|
||||||
-I tests/unit/libutil-support \
|
-I tests/unit/libutil-support \
|
||||||
$(INCLUDE_libexpr) \
|
$(INCLUDE_libexpr) \
|
||||||
|
$(INCLUDE_libexprc) \
|
||||||
$(INCLUDE_libfetchers) \
|
$(INCLUDE_libfetchers) \
|
||||||
$(INCLUDE_libstore) \
|
$(INCLUDE_libstore) \
|
||||||
$(INCLUDE_libutil)
|
$(INCLUDE_libstorec) \
|
||||||
|
$(INCLUDE_libutil) \
|
||||||
|
$(INCLUDE_libutilc)
|
||||||
|
|
||||||
libexpr-tests_CXXFLAGS += $(libexpr-tests_EXTRA_INCLUDES)
|
libexpr-tests_CXXFLAGS += $(libexpr-tests_EXTRA_INCLUDES)
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,9 @@ libstore-tests_EXTRA_INCLUDES = \
|
||||||
-I tests/unit/libstore-support \
|
-I tests/unit/libstore-support \
|
||||||
-I tests/unit/libutil-support \
|
-I tests/unit/libutil-support \
|
||||||
$(INCLUDE_libstore) \
|
$(INCLUDE_libstore) \
|
||||||
$(INCLUDE_libutil)
|
$(INCLUDE_libstorec) \
|
||||||
|
$(INCLUDE_libutil) \
|
||||||
|
$(INCLUDE_libutilc)
|
||||||
|
|
||||||
libstore-tests_CXXFLAGS += $(libstore-tests_EXTRA_INCLUDES)
|
libstore-tests_CXXFLAGS += $(libstore-tests_EXTRA_INCLUDES)
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,8 @@ libutil-tests_SOURCES := $(wildcard $(d)/*.cc)
|
||||||
|
|
||||||
libutil-tests_EXTRA_INCLUDES = \
|
libutil-tests_EXTRA_INCLUDES = \
|
||||||
-I tests/unit/libutil-support \
|
-I tests/unit/libutil-support \
|
||||||
$(INCLUDE_libutil)
|
$(INCLUDE_libutil) \
|
||||||
|
$(INCLUDE_libutilc)
|
||||||
|
|
||||||
libutil-tests_CXXFLAGS += $(libutil-tests_EXTRA_INCLUDES)
|
libutil-tests_CXXFLAGS += $(libutil-tests_EXTRA_INCLUDES)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
#include "config.hh"
|
#include "config.hh"
|
||||||
#include "args.hh"
|
#include "args.hh"
|
||||||
#include "nix_api_util.h"
|
#include "nix_api_util.h"
|
||||||
|
|
Loading…
Reference in a new issue