-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d97e72
commit 6118b00
Showing
18 changed files
with
137 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Submodule json
deleted from
66f6b4
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
add_subdirectory(my_lib) | ||
add_subdirectory(foo) | ||
add_subdirectory(bar) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <iostream> | ||
|
||
#include "nlohmann/json.hpp" | ||
|
||
#include "bar.h" | ||
|
||
int fn_branch(bool do_branch1, bool do_branch2) | ||
{ | ||
if (do_branch1 || do_branch2) | ||
return 0; | ||
|
||
return 1; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
template <typename T> | ||
T summing(T number1, T number2) | ||
{ | ||
return number1 + number2; | ||
} | ||
|
||
int fn_branch(bool do_branch1, bool do_branch2); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Sources and Headers | ||
set(LIBRARY_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/foo.cc") | ||
set(LIBRARY_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/foo.h") | ||
set(LIBRARY_INCLUDES "./" "${CMAKE_BINARY_DIR}/configured_files/include") | ||
|
||
# MyLib Library | ||
add_library(${LIB_FOO_NAME} STATIC ${LIBRARY_SOURCES} ${LIBRARY_HEADERS}) | ||
target_include_directories(${LIB_FOO_NAME} PUBLIC ${LIBRARY_INCLUDES}) | ||
target_link_libraries( | ||
${LIB_FOO_NAME} | ||
PRIVATE nlohmann_json::nlohmann_json | ||
fmt::fmt | ||
spdlog::spdlog | ||
cxxopts::cxxopts) | ||
|
||
if(${ENABLE_WARNINGS}) | ||
target_set_warnings( | ||
TARGET | ||
${LIB_FOO_NAME} | ||
ENABLE | ||
${ENABLE_WARNINGS} | ||
AS_ERRORS | ||
${ENABLE_WARNINGS_AS_ERRORS}) | ||
endif() | ||
|
||
if(${ENABLE_LTO}) | ||
target_enable_lto( | ||
TARGET | ||
${LIB_FOO_NAME} | ||
ENABLE | ||
ON) | ||
endif() | ||
|
||
if(${ENABLE_CLANG_TIDY}) | ||
add_clang_tidy_to_target(${LIB_FOO_NAME}) | ||
endif() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
#include "nlohmann/json.hpp" | ||
|
||
#include "my_lib.h" | ||
#include "foo.h" | ||
|
||
int print_hello_world() | ||
{ | ||
|
File renamed without changes.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include "bar.h" | ||
|
||
TEST_CASE("sum1") | ||
{ | ||
REQUIRE(summing(0, 1) == 1); | ||
REQUIRE(summing(1, 0) == 1); | ||
} | ||
|
||
TEST_CASE("branch1") | ||
{ | ||
REQUIRE(fn_branch(true, false) == 0); | ||
REQUIRE(fn_branch(true, true) == 0); | ||
REQUIRE(fn_branch(false, true) == 0); | ||
REQUIRE(fn_branch(false, false) == 1); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include "foo.h" | ||
|
||
TEST_CASE("factorial1") | ||
{ | ||
REQUIRE(factorial(0) == 1); | ||
REQUIRE(factorial(1) == 1); | ||
REQUIRE(factorial(2) == 2); | ||
REQUIRE(factorial(3) == 6); | ||
REQUIRE(factorial(10) == 3628800); | ||
} | ||
|
||
TEST_CASE("helloworld1") | ||
{ | ||
REQUIRE(print_hello_world() == 1); | ||
} |