CMake: add lib skeleton and google-tests

This commit is contained in:
2026-02-28 01:56:55 +01:00
parent 114f4ba834
commit 35b7645314
7 changed files with 87 additions and 0 deletions

24
pasada-lib/CMakeLists.txt Normal file
View File

@@ -0,0 +1,24 @@
project(Pasada_Lib)
SET(PASADA_SRC
library.cpp
)
if(PASADA_BUILD_TESTS)
# must build a STATIC library for google-tests to successfully consume us
# (otherwise, strange runtime errors ensue when trying to call into the lib)
add_library(pasada STATIC
${PASADA_SRC}
)
else()
add_library(pasada SHARED
${PASADA_SRC}
)
endif()
target_include_directories(pasada
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
set(CMAKE_CXX_STANDARD 20)

View File

@@ -0,0 +1,6 @@
#ifndef LIBPASADA_LIBRARY_H
#define LIBPASADA_LIBRARY_H
void hello();
#endif // LIBPASADA_LIBRARY_H

7
pasada-lib/library.cpp Normal file
View File

@@ -0,0 +1,7 @@
#include "library.h"
#include <iostream>
void hello() {
std::cout << "Hello, World!" << std::endl;
}