Skip to content

PCH forced inclusions not removed for libstdc++ std module precompilation #7560

@I-asked

Description

@I-asked

Xmake Version

v3.0.9+dev

Operating System Version and Architecture

Arch Linux BTW

Describe Bug

When using PCH and std modules with G++ ≥15 (libstdc++), module unit precompilation for bits/std.cc and bits/std.compat.cc is not exempt from forcible inclusion of PCH (-include pch.hxx).

Expected Behavior

PCH not forcibly included when precompiling bits/std.cc and bits/std.compat.cc

Project Configuration

xmake.lua

xmake.lua

add_rules('mode.debug', 'mode.release')

set_languages('gnuxxlatest')
set_policy('build.c++.modules.std', true)

set_toolchains('gcc')
set_runtimes('stdc++_static')

target('example')
	set_kind('binary')
	add_files('main.cxx')
	set_pcxxheader('pch.hxx')
	set_policy('build.c++.modules', true)
main.cxx

main.cxx

#include "pch.hxx"

import std;
import std.compat;

int main() {
	std::cerr << ::strerror(EAGAIN) << std::endl;
}
pch.hxx

pch.hxx

#pragma once

#include <unistd.h>
#include <errno.h>

Additional Information and Error Logs

I previously commented this on a now closed issue, but I'm also posting here with more details in case that was missed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions