make entryPoint a header
This commit is contained in:
47
flake.nix
47
flake.nix
@@ -18,32 +18,38 @@
|
|||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
in {
|
in {
|
||||||
|
|
||||||
Archimedes = pkgs.stdenvNoCC.mkDerivation {
|
Archimedes = {
|
||||||
|
examples = {
|
||||||
|
minimal = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
|
||||||
name = "Archimedes";
|
name = "Archimedes";
|
||||||
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
clang
|
clang
|
||||||
];
|
];
|
||||||
|
|
||||||
/*buildInputs = with pkgs; [
|
/*buildInputs = with pkgs; [
|
||||||
];*/
|
];*/
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
clang++ \
|
clang++ \
|
||||||
src/*.cpp \
|
src/*.cpp \
|
||||||
-I src -I include \
|
example_apps/MinimalApp/MinimalApp.cpp \
|
||||||
-Wall \
|
include/utils/App/*.cpp \
|
||||||
-o $name
|
-I src -I include \
|
||||||
'';
|
-Wall \
|
||||||
|
-o $name
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp $name $out/bin
|
cp $name $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
TestMenu = pkgs.stdenvNoCC.mkDerivation {
|
TestMenu = pkgs.stdenvNoCC.mkDerivation {
|
||||||
@@ -85,10 +91,11 @@
|
|||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
clang++ \
|
clang++ \
|
||||||
modules/Print/src/*.cpp \
|
modules/Print/src/*.cpp \
|
||||||
utils/App/App.cpp \
|
include/utils/App/App.cpp \
|
||||||
-fpic -shared \
|
-fpic -shared \
|
||||||
-I src -I include \
|
-I src -I include \
|
||||||
-Wall \
|
-Wall \
|
||||||
|
-DGUIMODULE_H \
|
||||||
-o $name
|
-o $name
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,6 @@
|
|||||||
#include "utils/GuiModule/GuiModule.h"
|
#include "utils/GuiModule/GuiModule.h"
|
||||||
#include "utils/App/App.h"
|
#include "utils/App/App.h"
|
||||||
|
|
||||||
|
#include "entryPoint.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
9
include/entryPoint.h
Normal file
9
include/entryPoint.h
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#ifdef APP_TYPE
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
APP_TYPE app;
|
||||||
|
app.handleArgs(argc, argv);
|
||||||
|
app.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef GUIMODULE_H
|
#ifdef GUIMODULE
|
||||||
#define GUIMODULE_H
|
#undef GUIMODULE
|
||||||
|
|
||||||
#include "utils/Module/Module.h"
|
#include "utils/Module/Module.h"
|
||||||
#include "utils/Window/Window.h"
|
#include "utils/Window/Window.h"
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
#include "pch.hpp"
|
|
||||||
#include "utils/App/App.h"
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
|
||||||
Archimedes::App app(argc, argv);
|
|
||||||
app.run();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user