Skip to content

Commit 966e1df

Browse files
authored
Merge pull request #3 from Ttibsi/fixing-buildx
2 parents ff049f6 + dd395c0 commit 966e1df

3 files changed

Lines changed: 19 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.30)
2-
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
32
project(willow-test LANGUAGES CXX)
43

4+
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
55
set(CMAKE_CXX_STANDARD 23)
66
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
77

@@ -12,5 +12,7 @@ add_compile_options(-Wconversion)
1212
add_compile_options(-Wimplicit-fallthrough)
1313

1414
add_subdirectory(src/willow)
15-
add_executable(willow_test src/main.cpp)
16-
target_link_libraries(willow_test PRIVATE willow)
15+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
16+
add_executable(willow_test src/main.cpp)
17+
target_link_libraries(willow_test PRIVATE willow)
18+
endif()

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ what you're doing, feel free to clone the repo and do what you need yourself.
99
```cmake
1010
include(FetchContent)
1111
fetchcontent_declare(
12-
rawterm
12+
willow
1313
GIT_REPOSITORY https://github.com/ttibsi/willow
1414
GIT_TAG v0.0.1
1515
)
16-
fetchcontent_makeavailable(rawterm)
16+
fetchcontent_makeavailable(willow)
1717
```
1818

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

2525
```cpp
26-
#include "willow/reporters.h"
27-
#include "willow/willow.h"
26+
#include <willow/reporters.h>
27+
#include <willow/willow.h>
2828

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

src/willow/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
add_library(willow STATIC
2-
willow.cpp
1+
add_library(willow STATIC)
2+
set_target_properties(willow PROPERTIES LINKER_LANGUAGE CXX)
3+
target_sources(willow
4+
# PRIVATE
5+
# foo.cpp
6+
PUBLIC
7+
reporters.h
8+
test.h
9+
willow.h
310
)
411

5-
target_include_directories(willow PUBLIC
6-
${CMAKE_CURRENT_SOURCE_DIR}/..
7-
)
12+
target_include_directories(willow PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)

0 commit comments

Comments
 (0)