kraken: bootstrap build system
This commit is contained in:
commit
5cd9e11979
19
CMakeLists.txt
Normal file
19
CMakeLists.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
project(kraken VERSION 0.0.0 LANGUAGES CXX)
|
||||
enable_testing()
|
||||
|
||||
# Add a dummy target to share all our compile options
|
||||
add_library(common_options INTERFACE)
|
||||
target_compile_features(common_options INTERFACE
|
||||
cxx_std_20
|
||||
)
|
||||
target_compile_options(common_options INTERFACE
|
||||
-Wall
|
||||
-Wextra
|
||||
)
|
||||
target_include_directories(common_options INTERFACE
|
||||
src
|
||||
)
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(tests)
|
4
src/CMakeLists.txt
Normal file
4
src/CMakeLists.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
add_executable(kraken kraken.cc)
|
||||
target_link_libraries(kraken PRIVATE common_options)
|
||||
|
||||
install(TARGETS kraken)
|
5
src/kraken.cc
Normal file
5
src/kraken.cc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello World!\n";
|
||||
}
|
1
tests/CMakeLists.txt
Normal file
1
tests/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
add_subdirectory(unit)
|
15
tests/unit/CMakeLists.txt
Normal file
15
tests/unit/CMakeLists.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
find_package(GTest)
|
||||
|
||||
if (${GTest_FOUND})
|
||||
include(GoogleTest)
|
||||
|
||||
add_executable(base_test base.cc)
|
||||
target_link_libraries(base_test PRIVATE common_options)
|
||||
|
||||
target_link_libraries(base_test PRIVATE
|
||||
GTest::gtest
|
||||
GTest::gtest_main
|
||||
)
|
||||
|
||||
gtest_discover_tests(base_test)
|
||||
endif (${GTest_FOUND})
|
5
tests/unit/base.cc
Normal file
5
tests/unit/base.cc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(misc, passing) {
|
||||
ASSERT_EQ(1, 1);
|
||||
}
|
Loading…
Reference in a new issue