Merge pull request #324905 from pwaller/hello-cpp

hello-cpp: init
This commit is contained in:
Aleksana
2024-07-12 18:31:54 +08:00
committed by GitHub
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
{
cmake,
lib,
ninja,
stdenv,
}:
stdenv.mkDerivation {
name = "hello-cpp";
src = ./src;
nativeBuildInputs = [ cmake ninja ];
meta = {
description = "Basic sanity check that C++ and cmake infrastructure are working";
platforms = lib.platforms.all;
maintainers = stdenv.meta.maintainers or [];
mainProgram = "hello-cpp";
};
}

View File

@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(hello-cpp)
add_executable(hello-cpp main.cpp)
install(TARGETS hello-cpp)

View File

@@ -0,0 +1,6 @@
#include <iostream>
int main(int argc, char *argv[]) {
std::cout << "Hello, C++\n";
return 0;
}