Handle bundled dependencies using __has_include (#128)

This commit is contained in:
Dr. Patrick Urbanke (劉自成)
2024-06-28 22:40:07 +02:00
committed by GitHub
parent 80aea11e0c
commit 641afd6f53
8 changed files with 8 additions and 10 deletions
+1 -3
View File
@@ -56,8 +56,7 @@ if(REFLECTCPP_USE_BUNDLED_DEPENDENCIES)
target_include_directories(
reflectcpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/rfl/thirdparty>)
$<INSTALL_INTERFACE:include>)
else()
add_library(reflectcpp INTERFACE)
@@ -66,7 +65,6 @@ else()
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include> )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DREFLECTCPP_NO_BUNDLED_DEPENDENCIES")
target_compile_features(reflectcpp INTERFACE cxx_std_20)
find_package(ctre CONFIG REQUIRED)
+1 -1
View File
@@ -3,7 +3,7 @@
#include <string>
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<ctre.h>)
#include <ctre.hpp>
#else
#include "thirdparty/ctre.hpp"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_JSON_READER_HPP_
#define RFL_JSON_READER_HPP_
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<yyjson.h>)
#include <yyjson.h>
#else
#include "../thirdparty/yyjson.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_JSON_WRITER_HPP_
#define RFL_JSON_WRITER_HPP_
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<yyjson.h>)
#include <yyjson.h>
#else
#include "../thirdparty/yyjson.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_JSON_READ_HPP_
#define RFL_JSON_READ_HPP_
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<yyjson.h>)
#include <yyjson.h>
#else
#include "../thirdparty/yyjson.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_JSON_SAVE_HPP_
#define RFL_JSON_SAVE_HPP_
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<yyjson.h>)
#include <yyjson.h>
#else
#include "../thirdparty/yyjson.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_JSON_TOSCHEMA_HPP_
#define RFL_JSON_TOSCHEMA_HPP_
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<yyjson.h>)
#include <yyjson.h>
#else
#include "../thirdparty/yyjson.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef RFL_JSON_WRITE_HPP_
#define RFL_JSON_WRITE_HPP_
#ifdef REFLECTCPP_NO_BUNDLED_DEPENDENCIES
#if __has_include(<yyjson.h>)
#include <yyjson.h>
#else
#include "../thirdparty/yyjson.h"