parent
36b64d29b9
commit
39ba4f5de2
9 changed files with 15 additions and 15 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
# This file is subject to the license terms in the LICENSE file
|
# This file is subject to the license terms in the LICENSE file
|
||||||
# found in the top-level directory of this distribution.
|
# found in the top-level directory of this distribution.
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
project(cppast VERSION 0.0)
|
project(cppast VERSION 0.0)
|
||||||
|
|
||||||
# options
|
# options
|
||||||
|
|
|
||||||
1
external/external.cmake
vendored
1
external/external.cmake
vendored
|
|
@ -46,6 +46,7 @@ if(build_tool)
|
||||||
execute_process(COMMAND git submodule update --init -- external/cxxopts
|
execute_process(COMMAND git submodule update --init -- external/cxxopts
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
set(CXXOPTS_BUILD_TESTS OFF)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/cxxopts EXCLUDE_FROM_ALL)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/external/cxxopts EXCLUDE_FROM_ALL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
# This file is subject to the license terms in the LICENSE file
|
# This file is subject to the license terms in the LICENSE file
|
||||||
# found in the top-level directory of this distribution.
|
# found in the top-level directory of this distribution.
|
||||||
|
|
||||||
# download catch
|
# Fetch catch.
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/catch.hpp)
|
message(STATUS "Fetching catch")
|
||||||
file(DOWNLOAD https://raw.githubusercontent.com/catchorg/Catch2/v2.x/single_include/catch2/catch.hpp
|
include(FetchContent)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/catch.hpp)
|
FetchContent_Declare(catch URL https://github.com/catchorg/Catch2/archive/v2.13.4.zip)
|
||||||
endif()
|
FetchContent_MakeAvailable(catch)
|
||||||
|
|
||||||
set(tests
|
set(tests
|
||||||
code_generator.cpp
|
code_generator.cpp
|
||||||
|
|
@ -42,9 +42,8 @@ foreach(file ${files})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_executable(cppast_test test.cpp test_parser.hpp ${tests})
|
add_executable(cppast_test test.cpp test_parser.hpp ${tests})
|
||||||
target_include_directories(cppast_test PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(cppast_test PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../src ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_include_directories(cppast_test PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../src)
|
target_link_libraries(cppast_test PUBLIC cppast Catch2)
|
||||||
target_link_libraries(cppast_test PUBLIC cppast)
|
|
||||||
target_compile_definitions(cppast_test PUBLIC CPPAST_INTEGRATION_FILE="${CMAKE_CURRENT_SOURCE_DIR}/integration.cpp"
|
target_compile_definitions(cppast_test PUBLIC CPPAST_INTEGRATION_FILE="${CMAKE_CURRENT_SOURCE_DIR}/integration.cpp"
|
||||||
CPPAST_COMPILE_COMMANDS="${CMAKE_BINARY_DIR}")
|
CPPAST_COMPILE_COMMANDS="${CMAKE_BINARY_DIR}")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <cppast/cpp_token.hpp>
|
#include <cppast/cpp_token.hpp>
|
||||||
|
|
||||||
#include <catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// This file is subject to the license terms in the LICENSE file
|
// This file is subject to the license terms in the LICENSE file
|
||||||
// found in the top-level directory of this distribution.
|
// found in the top-level directory of this distribution.
|
||||||
|
|
||||||
#include <catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
#include <cppast/libclang_parser.hpp>
|
#include <cppast/libclang_parser.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <cppast/parser.hpp>
|
#include <cppast/parser.hpp>
|
||||||
|
|
||||||
#include <catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
using namespace cppast;
|
using namespace cppast;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#include <catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include "libclang/preprocessor.hpp"
|
#include "libclang/preprocessor.hpp"
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
// found in the top-level directory of this distribution.
|
// found in the top-level directory of this distribution.
|
||||||
|
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN
|
||||||
#include <catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <catch.hpp>
|
#include <catch2/catch.hpp>
|
||||||
|
|
||||||
#include <cppast/code_generator.hpp>
|
#include <cppast/code_generator.hpp>
|
||||||
#include <cppast/cpp_class.hpp>
|
#include <cppast/cpp_class.hpp>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue