Skip to content

how should I split Cpp2 type definitions and function declarations to .h file ? #1058

Closed Answered by shemeshg
shemeshg asked this question in Q&A
Discussion options

You must be logged in to vote

ok, thanks to https://github.com/isidorostsa/RayTrayCpp2

I think settings the CMakeLists.txt to

cmake_minimum_required(VERSION 3.23)
project(example)

include(FetchContent)

FetchContent_Declare(
    cppfront
    GIT_REPOSITORY https://github.com/modern-cmake/cppfront.git
    GIT_TAG main  # or an actual git SHA if you don't like to live dangerously
)

FetchContent_MakeAvailable(cppfront)

add_executable(main main.cpp2)

set(cpp2headers 
    test.h2
)
#set(CPPFRONT_FLAGS "-pure-cpp2")
cppfront_generate_cpp(cpp1headers ${cpp2headers})

target_sources(main PUBLIC ${cpp1headers})

actually works...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shemeshg
Comment options

Answer selected by shemeshg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant