-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lab 1 done #42
base: main
Are you sure you want to change the base?
lab 1 done #42
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"cmake.sourceDirectory": "/Users/anujnaik/Desktop/HyTech/Software-Onboarding-2025/AnujNaik/lab1/part1" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
project(hello_world LANGUAGES CXX) | ||
cmake_minimum_required(VERSION 3.24) | ||
|
||
add_executable(test main.cpp) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <iostream> | ||
|
||
int main() | ||
{ | ||
std::cout << "Hello, World!\n"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
cmake_minimum_required(VERSION 3.24) | ||
project(lab1_part2 LANGUAGES CXX) | ||
add_library(part2lib SHARED src/part2.cpp) | ||
|
||
target_include_directories(part2lib PUBLIC include) | ||
|
||
add_executable(part2 app/main.cpp) | ||
|
||
target_link_libraries(part2 PUBLIC part2lib) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <part2.h> | ||
|
||
int main() { | ||
HelloWorldLib impl; | ||
impl.hello(); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
#include <iostream> | ||
|
||
class HelloWorldLib { | ||
public: | ||
HelloWorldLib() =default; | ||
void hello(); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <part2.h> | ||
// #include "../include/part2.h" | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
void HelloWorldLib::hello() { | ||
cout << "Hello World! (pt2)\n"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
project( | ||
ccp_playground VERSION 1.0 | ||
DESCRIPTION "Playing around with cmake" | ||
) | ||
|
||
add_library(hellolib STATIC src/hellolib.cpp) | ||
|
||
target_include_directories(hellolib PUBLIC include) | ||
add_executable(target src/main.cpp) | ||
|
||
target_link_libraries(target PUBLIC hellolib) | ||
|
||
set_target_properties(target PROPERTIES CXX_STANDARD 17) | ||
target_compile_features(target PRIVATE cxx_std_17) | ||
|
||
# Install the executable to bin directory | ||
install(TARGETS target DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ stdenv, cmake }: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "easy_cmake"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please change the name of this |
||
version = "0.1.0"; | ||
src = ./.; | ||
nativeBuildInputs = [ cmake ]; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
description = "vectornav c++ library"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please change the name |
||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; | ||
utils.url = "github:numtide/flake-utils"; | ||
easy_cmake.url = "github:RCMast3r/easy_cmake"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for easy cmake |
||
}; | ||
outputs = { self, nixpkgs, utils, easy_cmake }: | ||
let | ||
vn_lib_overlay = final: prev: { | ||
vn_lib = final.callPackage ./default.nix { }; | ||
}; | ||
py_vn_lib_overlay = final: prev: { | ||
py_vn_lib = final.callPackage ./python.nix { }; | ||
}; | ||
Comment on lines
+11
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please change names to what you are creating |
||
my_overlays = [ easy_cmake.overlays.default vn_lib_overlay py_vn_lib_overlay ]; | ||
pkgs = import nixpkgs { | ||
system = "aarch64-darwin"; | ||
overlays = [ self.overlays.default ]; | ||
}; | ||
in | ||
{ | ||
overlays.default = nixpkgs.lib.composeManyExtensions my_overlays; | ||
|
||
packages.aarch64-darwin = | ||
rec { | ||
vn_lib = pkgs.vn_lib; | ||
py_vn_lib = pkgs.py_vn_lib; | ||
default = vn_lib; | ||
}; | ||
|
||
devShells.aarch64-darwin.default = | ||
pkgs.mkShell rec { | ||
# Update the name to something that suites your project. | ||
name = "nix-devshell"; | ||
packages = with pkgs; [ | ||
# Development Tools | ||
cmake | ||
vn_lib | ||
]; | ||
|
||
# Setting up the environment variables you need during | ||
# development. | ||
shellHook = | ||
let | ||
icon = "f121"; | ||
in | ||
'' | ||
export PS1="$(echo -e '\u${icon}') {\[$(tput sgr0)\]\[\033[38;5;228m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]} (${name}) \\$ \[$(tput sgr0)\]" | ||
''; | ||
}; | ||
|
||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
#include <iostream> | ||
|
||
class HelloWorldLib { | ||
public: | ||
HelloWorldLib() = default; | ||
void hello(); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/nix/store/n1ix33gw5177c25gdc5ki34jdsgd1aj2-easy_cmake-0.1.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <hellolib.hpp> | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
void HelloWorldLib::hello() { | ||
cout << "Hello World! (pt2)\n"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include <hellolib.hpp> | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int main() { | ||
HelloWorldLib lib; | ||
lib.hello(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
{ stdenv, cmake, hellolib }: | ||
|
||
#make Derivation | ||
stdenv.mkDerivation { | ||
pname = "helloapp"; | ||
version = "0.1.0"; | ||
src = ./helloapp; | ||
|
||
#make install | ||
nativeBuildInputs = [ cmake ]; | ||
buildInputs = [ hellolib ]; | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please dont push commented code