Skip to content

Commit

Permalink
linux: link libstdc++ statically for gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 committed Oct 15, 2024
1 parent c63c476 commit a4ed72b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ jobs:
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3

- name: Setup meson (MacOS)
if: matrix.config.os == 'macos'
run: |
Expand Down
14 changes: 13 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# type: ignore
{
"variables": {
"oopetris_compiler": "<!(pkg-config oopetris-recordings --variable=compiler)",
},
"targets": [
{
"target_name": "oopetris",
Expand Down Expand Up @@ -40,6 +43,15 @@
}
},
],
[
'OS == "linux" and oopetris_compiler == "gcc"',
{
"cflags_cc": [
"-static-libgcc", # to build with a static libgcc (libgcc_s)
"-static-libstdc++", # to build with a static libstdc++
]
},
],
[
'OS != "win"',
{
Expand Down Expand Up @@ -81,7 +93,7 @@
"VCLinkerTool": {
"AdditionalDependencies": [
# adjust to the default setting, namely lib<name>.a via some sed magic
"<!@(pkg-config oopetris-recordings --libs-only-l | sed s/-l/lib/g | sed \"s/\\s/.a /g\")",
'<!@(pkg-config oopetris-recordings --libs-only-l | sed s/-l/lib/g | sed "s/\\s/.a /g")',
],
},
},
Expand Down

0 comments on commit a4ed72b

Please sign in to comment.