Created
December 30, 2024 10:21
-
-
Save Osse/d40fc9cbc7072a9e4d502e9fa21ca72c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile_commands.json | |
build | |
.cache | |
out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.28) | |
project(mylib) | |
option(BUILD_SHARED_LIBS "Build using shared libraries" ON) | |
set(CMAKE_CXX_STANDARD 20) | |
add_library(mylib mylib.cpp) | |
target_include_directories(mylib PUBLIC "${CMAKE_CURRENT_LIST_DIR}/include") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 3, | |
"cmakeMinimumRequired": { | |
"major": 3, | |
"minor": 22 | |
}, | |
"configurePresets": [ | |
{ | |
"hidden": true, | |
"name": "base", | |
"generator": "Ninja", | |
"binaryDir": "build/${presetName}" | |
}, | |
{ | |
"name": "Debug", | |
"inherits": "base", | |
"cacheVariables": { | |
"CMAKE_BUILD_TYPE": "Debug" | |
} | |
}, | |
{ | |
"name": "Release", | |
"inherits": "base", | |
"cacheVariables": { | |
"CMAKE_BUILD_TYPE": "Release" | |
} | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "mylib.h" | |
int main(int argc, char *argv[]) | |
{ | |
Thing t(5); | |
t.output(std::string_view("lol")); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "include/mylib.h" | |
std::string_view Thing::prefix() const | |
{ | |
return std::string_view("hello: "); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string_view> | |
struct Thing { | |
public: | |
Thing(int i) : i(i) {} | |
template<typename T> | |
void output(T t) const { | |
std::cout << prefix() << t << '\n'; | |
} | |
private: | |
std::string_view prefix() const; | |
int i; | |
}; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true; do | |
rm -rf ~/.cache/cmake_tools_nvim/homeossedevdep* build | |
nvim main/main.cpp || break | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment