Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test with multiple translation units #2301

Merged
merged 5 commits into from
Jul 23, 2020
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
3 changes: 3 additions & 0 deletions test/cmake_target_include_directories/project/Bar.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "Bar.hpp"

class Bar;
4 changes: 4 additions & 0 deletions test/cmake_target_include_directories/project/Bar.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <nlohmann/json.hpp>
#include "Foo.hpp"

class Bar : public Foo{};
10 changes: 10 additions & 0 deletions test/cmake_target_include_directories/project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ set_target_properties(with_private_target PROPERTIES CXX_STANDARD 11)
add_executable(with_private_system_target main.cpp)
target_include_directories(with_private_system_target PRIVATE SYSTEM ${nlohmann_json_source}/include)
set_target_properties(with_private_system_target PROPERTIES CXX_STANDARD 11)

# regression from https://github.com/nlohmann/json/discussions/2281
add_library(Foo STATIC Foo.cpp Bar.cpp)
target_include_directories(Foo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${nlohmann_json_source}/include)
set_target_properties(Foo PROPERTIES CXX_STANDARD 11)

add_library(Bar STATIC Bar.cpp)
target_link_libraries(Bar PRIVATE Foo)
target_include_directories(Bar PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${nlohmann_json_source}/include)
set_target_properties(Bar PROPERTIES CXX_STANDARD 11)
3 changes: 3 additions & 0 deletions test/cmake_target_include_directories/project/Foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "Foo.hpp"

class Foo;
4 changes: 4 additions & 0 deletions test/cmake_target_include_directories/project/Foo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once
#include <nlohmann/json.hpp>

class Foo{};