Skip to content

Instantly share code, notes, and snippets.

@mikedld
Created September 8, 2021 19:52
Show Gist options
  • Save mikedld/8dfdc9e89ebd64edaed46026f4dae4c8 to your computer and use it in GitHub Desktop.
Save mikedld/8dfdc9e89ebd64edaed46026f4dae4c8 to your computer and use it in GitHub Desktop.
CMake + PCH example
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(test_pch LANGUAGES CXX)
add_library(test_pch STATIC
test_pch.cpp)
target_precompile_headers(test_pch
PRIVATE
test_pch.h)
#include "test_pch.h"
int main() {
std::cout << "Hello, world!" << std::endl;
return 0;
}
#pragma once
#include <iostream>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment