nix-build: + xo-object2 builds

This commit is contained in:
Roland Conybeare 2026-02-27 13:04:46 +11:00
commit 6dd635599c
4 changed files with 63 additions and 0 deletions

View file

@ -152,6 +152,7 @@ let
xo-alloc2 = self.callPackage pkgs/xo-alloc2.nix { stdenv = jitStdenv; buildDocs = true; };
xo-gc = self.callPackage pkgs/xo-gc.nix { stdenv = jitStdenv; buildDocs = true; };
xo-object = self.callPackage pkgs/xo-object.nix { stdenv = jitStdenv; };
xo-object2 = self.callPackage pkgs/xo-object2.nix { stdenv = jitStdenv; };
xo-refcnt = self.callPackage pkgs/xo-refcnt.nix { stdenv = jitStdenv; };
xo-ordinaltree = self.callPackage pkgs/xo-ordinaltree.nix { stdenv = jitStdenv; };
xo-pyutil = self.callPackage pkgs/xo-pyutil.nix { stdenv = jitStdenv; };
@ -501,6 +502,7 @@ in
alloc2 = pkgs.xo-alloc2;
gc = pkgs.xo-gc;
object = pkgs.xo-object;
object2 = pkgs.xo-object2;
ordinaltree = pkgs.xo-ordinaltree;
flatstring = pkgs.xo-flatstring;
pyutil = pkgs.xo-pyutil;

48
pkgs/xo-object2.nix Normal file
View file

@ -0,0 +1,48 @@
{
# nixpkgs dependencies
lib, stdenv, cmake, catch2,
# xo dependencies
# xo-webutil,
# xo-callback,
# xo-unit,
# xo-refcnt,
# xo-reflectutil,
# xo-alloc,
# xo-randomgen,
xo-reflect,
xo-gc,
xo-printable2,
xo-facet,
xo-subsys,
xo-cmake,
# xo-printjson,
# xo-ordinaltree,
# xo-indentlog,
doCheck ? true,
} :
stdenv.mkDerivation (finalattrs:
{
name = "xo-object2";
src = ../xo-object2;
cmakeFlags = ["-DCMAKE_MODULE_PATH=${xo-cmake}/share/cmake"]
++ lib.optionals doCheck ["-DENABLE_TESTING=1"];
inherit doCheck;
nativeBuildInputs = [
cmake catch2
# xo-randomgen
xo-cmake
];
propagatedBuildInputs = [
xo-reflect
xo-gc
xo-printable2
xo-subsys
xo-facet
];
})

View file

@ -1748,6 +1748,18 @@ function(xo_add_genfacetimpl)
if (NOT DEFINED GF_FACET_PKG)
message(FATAL_ERROR "xo_add_genfacetimpl: FACET_PKG or FACET_DIR required")
else()
# share_${GF_FACET_PKG} is a cmake target created by xo_add_shared_library4()
# or similar when a facet-provider (e.g. xo-gc) builds from source in the same
# cmake context (XO_SUBMODULE_BUILD=True).
#
# It is NOT exported in the installed cmake
# config, so it won't exist when the facet package is consumed as an installed
# dependency (e.g. in a standalone nix build).
#
if(NOT TARGET share_${GF_FACET_PKG})
message(STATUS "xo_add_genfacetimpl: share_${GF_FACET_PKG} not available; skipping ${GF_TARGET}")
return()
endif()
get_target_property(_facet_dir share_${GF_FACET_PKG} path)
set(GF_FACET_DIR ${_facet_dir})
endif()

View file

@ -3,6 +3,7 @@
**/
#include "sequence/ISequence_Any.hpp"
#include <exception>
#include <iostream>
namespace xo {