mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 19:34:06 +00:00
hello-cpp: init
Proposal: a trivial hello-cpp to complement gnu hello, testing C++ and cmake infrastructure. This is intended to assist with testing exotic stdenvs such as the one used in pkgsLLVM, requiring no additional dependencies to get a quick test that the compiler and cmake are working as intended as a basic level. There does already exist tests.cc-wrapper, but this does not produce any outputs, and sometimes it is useful to have a quick test that something builds. It's also useful to be able to inspect the outputs to look at references and so forth. Signed-off-by: Peter Waller <p@pwaller.net>
This commit is contained in:
parent
628268f239
commit
f2603c72fb
18
pkgs/by-name/he/hello-cpp/package.nix
Normal file
18
pkgs/by-name/he/hello-cpp/package.nix
Normal 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";
|
||||
};
|
||||
}
|
6
pkgs/by-name/he/hello-cpp/src/CMakeLists.txt
Normal file
6
pkgs/by-name/he/hello-cpp/src/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(hello-cpp)
|
||||
|
||||
add_executable(hello-cpp main.cpp)
|
||||
|
||||
install(TARGETS hello-cpp)
|
6
pkgs/by-name/he/hello-cpp/src/main.cpp
Normal file
6
pkgs/by-name/he/hello-cpp/src/main.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
std::cout << "Hello, C++\n";
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user