Skip to content

Commit 9aa7d44

Browse files
authored
[emscan-deps] Add full set of default include paths (#23568)
Specifically we were missing the `include/compat` directory which is needed for including `<xlocale.h>`, which is transitively required by `<iostream>`. Fixes: #23567
1 parent 8d4fb01 commit 9aa7d44

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

emscan-deps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"""
1111

1212
import sys
13-
from tools import shared, cache
13+
import emcc
14+
from tools import shared
1415

1516
args = sys.argv[1:]
16-
args.append('--sysroot=' + cache.get_sysroot(absolute=True))
17-
args.append('--target=' + shared.get_llvm_target())
17+
args += emcc.get_cflags(tuple(args))
1818
shared.exec_process([shared.CLANG_SCAN_DEPS] + args)

test/cmake/cxx20/main.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
// University of Illinois/NCSA Open Source License. Both these licenses can be
44
// found in the LICENSE file.
55

6-
#include <stdio.h>
7-
8-
class Test {}; // This will fail in C mode
6+
#include <iostream>
97

108
int main() {
11-
printf("hello, world!\n");
9+
std::cout << "hello, world!" << std::endl;
1210
return 0;
1311
}

0 commit comments

Comments
 (0)