Skip to content

Commit

Permalink
Link with libcc's libc++ on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Feb 23, 2018
1 parent b7b40d9 commit 9fec1a3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
21 changes: 20 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@
'-Wl,--no-whole-archive',
],
}, {
'libraries': [ '<@(libchromiumcontent_v8_libraries)' ],
'libraries': [
'<@(libchromiumcontent_v8_libraries)',
'<(libchromiumcontent_dir)/libc++.so',
],
}],
],
}],
Expand Down Expand Up @@ -243,6 +246,22 @@
}], # OS=="win"
],
}],
['OS=="linux" and _target_name in ["dump_syms"]', {
'conditions': [
['libchromiumcontent_component==0', {
'libraries': [
'<(libchromiumcontent_dir)/libc++.a',
],
}, {
'libraries': [
'<(libchromiumcontent_dir)/libc++.so',
],
'ldflags': [
'-Wl,-rpath=\$$ORIGIN',
],
}],
],
}]
],
'msvs_cygwin_shell': 0, # Strangely setting it to 1 would make building under cygwin fail.
'msvs_disabled_warnings': [
Expand Down
18 changes: 13 additions & 5 deletions toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@
['CXX.host', '$(CXX)'],
],
'target_defaults': {
'cflags_cc': [
'-std=c++14',
],
'xcode_settings': {
'CC': '<(make_clang_dir)/bin/clang',
'LDPLUSPLUS': '<(make_clang_dir)/bin/clang++',
Expand All @@ -125,13 +122,24 @@
'CLANG_CXX_LANGUAGE_STANDARD': 'c++14', # -std=c++14
},
'target_conditions': [
['_type in ["executable", "shared_library"]', {
['OS=="mac" and _type in ["executable", "shared_library"]', {
'xcode_settings': {
# On some machines setting CLANG_CXX_LIBRARY doesn't work for
# linker.
'OTHER_LDFLAGS': [ '-stdlib=libc++' ],
},
}],
['OS=="linux"', {
'cflags_cc': [
'-std=gnu++14',
'-nostdinc++',
'-isystem<(libchromiumcontent_src_dir)/buildtools/third_party/libc++/trunk/include',
'-isystem<(libchromiumcontent_src_dir)/buildtools/third_party/libc++abi/trunk/include',
],
'ldflags': [
'-nostdlib++',
],
}],
],
},
}], # clang==1
Expand All @@ -145,7 +153,7 @@
],
'target_defaults': {
'cflags_cc': [
'-std=c++11',
'-std=gnu++14',
],
},
}],
Expand Down

0 comments on commit 9fec1a3

Please sign in to comment.