Skip to content

Commit

Permalink
default c++ build config tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
tbali0524 committed Feb 23, 2024
1 parent 2c826c7 commit b4afcaf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion .cgtest.full.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
'languages' => array_merge(PHP_OS_FAMILY != 'Windows' ? [
// tested on Linux only
'bash',
'c++',
// 'clojure', // untested
// 'objective-c', // untested
'ocaml', // tested on Linux only
Expand Down
2 changes: 1 addition & 1 deletion .cgtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
// Note: can be overriden via the '--lang=...' command-line option
'languages' => array_merge(PHP_OS_FAMILY != 'Windows' ? [
'bash',
'c++',
// 'clojure', // untested
// 'objective-c', // untested
'ocaml', // tested on Linux only
// 'swift', // untested
] : [], [
'c',
'c++',
'c#',
'd',
'dart',
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Show the language versions used during normal test runs with `--verbose`.
- Github Actions updated.
- default c++ build command on Windows include `-static-libgcc -static-libstdc++`

### Fixed

Expand Down
10 changes: 8 additions & 2 deletions cgtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@
'sourceExtension' => '.sh',
'codinGameVersion' => 'GNU bash, version 5.1.16(1)',
'versionCommand' => 'bash --version',
'buildCommand' => 'chmod +x %s',
'buildCommand' => (PHP_OS_FAMILY != 'Windows'
? 'chmod +x %s'
: ''
),
'runCommand' => '%s',
'cleanPatterns' => [],
],
Expand Down Expand Up @@ -154,7 +157,10 @@
'codinGameVersion' => 'g++ 11.2.0-20',
'versionCommand' => 'g++ --version',
// note: omitting -ldl -lcrypt from CG settings
'buildCommand' => 'g++ -lm -lpthread -m64 -std=c++17 -x c++ -o %b%p_%l.exe %s',
'buildCommand' => (PHP_OS_FAMILY != 'Windows'
? 'g++ -lm -lpthread -m64 -std=c++17 -x c++ -o %b%p_%l.exe %s'
: 'g++ -static-libgcc -static-libstdc++ -lm -lpthread -m64 -std=c++17 -x c++ -o %b%p_%l.exe %s'
),
'runCommand' => '%b%p_%l.exe',
'cleanPatterns' => ['%b%p_%l.exe'],
],
Expand Down

0 comments on commit b4afcaf

Please sign in to comment.