Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.30)
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
project(willow-test LANGUAGES CXX)

set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Expand All @@ -12,5 +12,7 @@ add_compile_options(-Wconversion)
add_compile_options(-Wimplicit-fallthrough)

add_subdirectory(src/willow)
add_executable(willow_test src/main.cpp)
target_link_libraries(willow_test PRIVATE willow)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_executable(willow_test src/main.cpp)
target_link_libraries(willow_test PRIVATE willow)
endif()
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ what you're doing, feel free to clone the repo and do what you need yourself.
```cmake
include(FetchContent)
fetchcontent_declare(
rawterm
willow
GIT_REPOSITORY https://github.com/ttibsi/willow
GIT_TAG v0.0.1
)
fetchcontent_makeavailable(rawterm)
fetchcontent_makeavailable(willow)
```

# Example
Expand All @@ -23,8 +23,8 @@ file -- anything in the `src/` directory are the tests for this project,
`src/willow` is the source code.

```cpp
#include "willow/reporters.h"
#include "willow/willow.h"
#include <willow/reporters.h>
#include <willow/willow.h>

auto add(int x, int y) -> int { return x + y; }

Expand Down
15 changes: 10 additions & 5 deletions src/willow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
add_library(willow STATIC
willow.cpp
add_library(willow STATIC)
set_target_properties(willow PROPERTIES LINKER_LANGUAGE CXX)
target_sources(willow
# PRIVATE
# foo.cpp
PUBLIC
reporters.h
test.h
willow.h
)

target_include_directories(willow PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/..
)
target_include_directories(willow PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
Loading