test static dependencies
This commit is contained in:
31
flake.nix
31
flake.nix
@@ -160,7 +160,36 @@
|
||||
|
||||
buildPhase = ''
|
||||
clang++ \
|
||||
modules/DependsOnPrint/src/*.cpp src/App.cpp \
|
||||
modules/DependsOnPrint/src/*.cpp \
|
||||
include/utils/App/App.cpp \
|
||||
-fpic -shared \
|
||||
-I src -I include \
|
||||
-Wall \
|
||||
-o $name
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp $name $out/bin
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
DependsOnPrintStatic = pkgs.stdenvNoCC.mkDerivation {
|
||||
|
||||
name = "DependsOnPrint";
|
||||
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
clang
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
clang++ \
|
||||
modules/DependsOnPrint/src/*.cpp \
|
||||
modules/Print/src/*.cpp \
|
||||
include/utils/App/App.cpp \
|
||||
-fpic -shared \
|
||||
-I src -I include \
|
||||
-Wall \
|
||||
|
||||
17
modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp
Normal file
17
modules/DependsOnPrintStatic/src/DependsOnPrintStatic.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "DependsOnPrintStatic.h"
|
||||
#include "modules/Print/src/Print.h"
|
||||
|
||||
DependsOnPrintStatic::DependsOnPrintStatic(void* h, Archimedes::App* a) : Module(h, a) {
|
||||
name = "DependsOnPrintStatic";
|
||||
|
||||
deps["Print"] = new Print(nullptr, a);
|
||||
}
|
||||
|
||||
DependsOnPrintStatic::~DependsOnPrintStatic() {
|
||||
std::cout << "DependsOnPrintStatic Destroyed!\n";
|
||||
}
|
||||
|
||||
void DependsOnPrintStatic::run() {
|
||||
std::cout << "DependsOnPrintStatic lib loaded and run!\n";
|
||||
app->stopModule(self);
|
||||
}
|
||||
17
modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h
Normal file
17
modules/DependsOnPrintStatic/src/DependsOnPrintStatic.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
class DependsOnPrintStatic : public Archimedes::Module {
|
||||
|
||||
public:
|
||||
DependsOnPrintStatic(void*, Archimedes::App*);
|
||||
~DependsOnPrintStatic();
|
||||
void run();
|
||||
void onLoad() {}
|
||||
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
Archimedes::Module* create(void* handle, Archimedes::App* app) {
|
||||
return new DependsOnPrintStatic(handle, app);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user