Skip to content

Instantly share code, notes, and snippets.

View nonchip's full-sized avatar
‼️
this is mostly to read/fork/archive. same name on gitlab because fuck microsoft.

Kyra Zimmer nonchip

‼️
this is mostly to read/fork/archive. same name on gitlab because fuck microsoft.
View GitHub Profile
@MikuAuahDark
MikuAuahDark / stringstream.lua
Last active November 5, 2021 06:48
Lua 5.1 stringstream (pure)
local stringstream = {}
stringstream.__index = stringstream
function stringstream.create(str)
local out = setmetatable({}, stringstream)
out.buffer = str or ""
out.pos = 0
out.__index = stringstream
return out
@jlgerber
jlgerber / CMakeLists.txt
Last active May 21, 2024 20:28
cmake - handling executable and library with same name
# Lets say we want to add a library and an executable, both with the same name.
# In this example, it is resman
add_library(resman ${src_cpps} ${src_hpps} )
target_link_libraries(resman ${Boost_LIBRARIES} ${LIBYAML} ${LIBFMT})
#
# Add resman executable
#
# We call the executable resman-bin
add_executable(resman-bin main.cpp )
@samee
samee / CMakeLists.txt
Created November 29, 2019 21:17
Using ExternalProject with cmake
cmake_minimum_required(VERSION 3.10)
include(ExternalProject)
ExternalProject_Add(fmtlib
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
EXCLUDE_FROM_ALL TRUE
BUILD_COMMAND $(MAKE) fmt
STEP_TARGETS build)
set(fmtlib_BINARY_DIR "${CMAKE_BINARY_DIR}/fmtlib-prefix/src/fmtlib-build")
set(fmtlib_SOURCE_DIR "${CMAKE_BINARY_DIR}/fmtlib-prefix/src/fmtlib/include")
add_executable(fmttest fmttest.cpp)