Skip to content

Instantly share code, notes, and snippets.

View sheredom's full-sized avatar
👷
building things

Neil Henning sheredom

👷
building things
View GitHub Profile
@sheredom
sheredom / gist:a6a513e7262a74324ae5506c4d59503a
Created June 9, 2020 19:49
Weird macOS behaviour with linking
// a.c
#include <stdio.h>
void is_not_called(void) __attribute__((constructor)) {
printf("This isn't called!\n");
}
// b.c
#include <stdio.h>
@sheredom
sheredom / CMakeLists.txt
Created May 23, 2019 15:05
LLVM plugin CMake
# LLVM requires C++11.
set(CMAKE_CXX_STANDARD 11)
# Find LLVM (this looks for LLVMConfig.cmake somewhere in the PATH or LLVM_DIR).
find_package(LLVM REQUIRED CONFIG)
# Enable us to use the LLVM CMake modules.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LLVM_CMAKE_DIR}")
# Enable us to use add_llvm_library.
@sheredom
sheredom / VkComputeSample
Created May 29, 2016 19:14
A simple Vulkan compute sample
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit