Skip to content

Instantly share code, notes, and snippets.

@MambaWong
MambaWong / build.sh
Created July 24, 2024 15:11 — forked from ppoffice/build.sh
Minimal Linux Build Script
#!/bin/sh
# Modified from ivandavidov/minimal-linux-script
# https://github.com/ivandavidov/minimal-linux-script
# This script includes a dynamic linked busybox, openssl, python and
# network support
set -ex
KERNEL_VERSION=4.17.2
BUSYBOX_VERSION=1.28.4
@MambaWong
MambaWong / uni_init.cpp
Created September 23, 2017 10:17 — forked from ashwin/uni_init.cpp
Examples of uniform initialization syntax in C++
#include <iostream>
#include <stack>
#include <unordered_set>
#include <vector>
class Point
{
public:
int x;
int y;
@MambaWong
MambaWong / CMakeLists.txt
Created May 1, 2016 00:39 — forked from socantre/CMakeLists.txt
Example of using add_custom_command and add_custom_target together in CMake to handle custom build steps with minimal rebuilding: This example untars library headers for an INTERFACE library target
set(LIBFOO_TAR_HEADERS
"${CMAKE_CURRENT_BINARY_DIR}/include/foo/foo.h"
"${CMAKE_CURRENT_BINARY_DIR}/include/foo/foo_utils.h"
)
add_custom_command(OUTPUT ${LIBFOO_TAR_HEADERS}
COMMAND ${CMAKE_COMMAND} -E tar xzf "${CMAKE_CURRENT_SOURCE_DIR}/libfoo/foo.tar"
COMMAND ${CMAKE_COMMAND} -E touch ${LIBFOO_TAR_HEADERS}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/include/foo"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/libfoo/foo.tar"
@MambaWong
MambaWong / function-argument.cmake
Created April 30, 2016 14:59 — forked from antiagainst/function-argument.cmake
ARGC, ARGV, ARGN, ARGVn in CMake
cmake_minimum_required(VERSION 2.8)
function(use_llvm TARGET)
message("ARGC=\"${ARGC}\"")
message("ARGN=\"${ARGN}\"")
message("ARGV=\"${ARGV}\"")
message("ARGV0=\"${ARGV0}\"")
message("ARGV1=\"${ARGV1}\"")
endfunction()