public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Errors when trying to use C++ modules with cmake and GCC
@ 2023-02-01 10:52 HHN
  2023-02-01 11:00 ` Jonathan Wakely
  0 siblings, 1 reply; 7+ messages in thread
From: HHN @ 2023-02-01 10:52 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]

I have been working on upgrading the HPX build system to support C++
modules, while trying to experiment with GCC support for C++ modules, I
keep running into this issue of unrecognized command-line options.

`
g++: error: unrecognized command-line option
‘-fdep-file=CMakeFiles/std_module_example.dir/t3.cxx.o.ddi’
g++: error: unrecognized command-line option
‘-fdep-output=CMakeFiles/std_module_example.dir/t3.cxx.o’
g++: error: unrecognized command-line option ‘-fdep-format=trtbd’


The following in the CMakeLists.txt file :

cmake_minimum_required(VERSION 3.23)
project(std_module_example CXX)
set(CMAKE_CXX_COMPILER "/home/hhn/makes/gcc-install/usr/local/bin/g++")

message(STATUS "${CMAKE_CXX_COMPILER}")

set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API
"2182bf5c-ef0d-489a-91da-49dbc3090d2a")

if(WIN32)
include(msvc_modules.cmake)
else()
include(gcc_modules.cmake)
endif()

set(CMAKE_CXX_STANDARD 20)

add_library(std_module_example)
target_link_libraries(std_module_example)

target_sources(std_module_example
PRIVATE
t4.cxx
PUBLIC
FILE_SET cxx_modules TYPE CXX_MODULES FILES
t1.cxx t2.cxx t3.cxx
)

add_executable(main main.cxx)
target_link_libraries(main std_module_example)


`

I have tried this with g++ 11.3, g++ 12.1 installed using ubuntu package
managers,
I have also tried the same using this certain patch
<https://github.com/mathstuf/gcc/tree/p1689r5> as suggested by the user on
an online forum
<https://discourse.cmake.org/t/module-support-for-g-and-clang/7367/2>.
I have also tried the same using the master
<https://github.com/gcc-mirror/gcc> and devel/c++-modules
<https://github.com/gcc-mirror/gcc/tree/devel/c++-modules> branch on gcc
repo.

All of them have given the same errors. Also the devel/c++-modules branch
compiles to g++ version of g++ (GCC) 11.0.0 20210203 (experimental)
[c++-modules revision 20230201-1505], while the master branch has
version g++ (GCC) 13.0.1 20230201 (experimental).





-- 
Hari Hara Naveen

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-08 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 10:52 Errors when trying to use C++ modules with cmake and GCC HHN
2023-02-01 11:00 ` Jonathan Wakely
2023-02-08  9:48   ` HHN
2023-02-08 10:35     ` Jonathan Wakely
2023-02-08 12:14       ` HHN
2023-02-08 12:27         ` Jonathan Wakely
2023-02-08 12:32           ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).