C++20/23 Modules support

lukash256
Posts: 2
Joined: Tue Aug 20, 2024 3:01 pm

C++20/23 Modules support

Postby lukash256 » Tue Aug 20, 2024 3:30 pm

hello !

I am trying to follow new style of codding and I think that it's time to start new project with C++ Modules
but I get in troubles with compilation.

I just try to follow official tutorial from KitWare site https://www.kitware.com/import-cmake-th ... t-is-over/
and combine it with material from this forum

my CMakeLists.txt:

Code: Select all

add_library(mod)
target_sources(mod
	PUBLIC
	FILE_SET CXX_MODULES FILES
	"mod.cxx"
)

idf_component_register(SRCS "main.cxx"
                    INCLUDE_DIRS ".")


target_link_libraries(COMPONENT_LIB PUBLIC mod)

but it seams that "add_library" command is not supported:
CMake Error at D:/Espressif/frameworks/esp-idf-v5.3/tools/cmake/component.cmake:225 (message):
CMake Warning (dev) at build_properties.temp.cmake:8:

Syntax Warning in cmake code at column 106



Argument not separated from preceding token by whitespace.

Call Stack (most recent call first):

D:/Espressif/frameworks/esp-idf-v5.3/tools/cmake/scripts/component_get_requirements.cmake:3 (include)

This warning is for project developers. Use -Wno-dev to suppress it.



fatal: not a git repository (or any of the parent directories): .git

CMake Error at C:/Users/lukash256/esp32
proj/tstForGopher/main/CMakeLists.txt:2 (add_library):

add_library command is not scriptable

Call Stack (most recent call first):

D:/Espressif/frameworks/esp-idf-v5.3/tools/cmake/scripts/component_get_requirements.cmake:107 (include)
D:/Espressif/frameworks/esp-idf-v5.3/tools/cmake/scripts/component_get_requirements.cmake:127 (__component_get_requirements)





Call Stack (most recent call first):
D:/Espressif/frameworks/esp-idf-v5.3/tools/cmake/build.cmake:586 (__component_get_requirements)
D:/Espressif/frameworks/esp-idf-v5.3/tools/cmake/project.cmake:710 (idf_build_process)
CMakeLists.txt:11 (project)


-- Configuring incomplete, errors occurred!


sooo Can anybody share knowledges about building esp_idf project based on c++ Modules ?

aliarifat794
Posts: 200
Joined: Sun Jun 23, 2024 6:18 pm

Re: C++20/23 Modules support

Postby aliarifat794 » Wed Aug 21, 2024 11:37 am


lukash256
Posts: 2
Joined: Tue Aug 20, 2024 3:01 pm

Re: C++20/23 Modules support

Postby lukash256 » Wed Aug 21, 2024 3:15 pm

I have already checked it.
Thanks

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: C++20/23 Modules support

Postby chegewara » Wed Aug 21, 2024 7:26 pm

I would suggest to remove/replace this

Code: Select all

add_library(mod)
....

add_library command is not scriptable  <----------------

https://github.com/espressif/esp-idf/is ... 1827342060

Who is online

Users browsing this forum: Corand, Google [Bot] and 180 guests