Created
September 8, 2021 19:52
-
-
Save mikedld/8dfdc9e89ebd64edaed46026f4dae4c8 to your computer and use it in GitHub Desktop.
CMake + PCH example
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.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) |
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 "test_pch.h" | |
int main() { | |
std::cout << "Hello, world!" << std::endl; | |
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
#pragma once | |
#include <iostream> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment