Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
be76cec3
Commit
be76cec3
authored
Sep 13, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix warnings for invalid C++ option with `enable_cxx_abi`; ref #3618, #4703
parent
ad4bdda0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
lib/mruby/build.rb
lib/mruby/build.rb
+1
-1
lib/mruby/build/command.rb
lib/mruby/build/command.rb
+2
-1
tasks/toolchains/gcc.rake
tasks/toolchains/gcc.rake
+6
-3
travis_config.rb
travis_config.rb
+1
-1
No files found.
lib/mruby/build.rb
View file @
be76cec3
...
...
@@ -162,7 +162,7 @@ module MRuby
compilers
.
each
{
|
c
|
c
.
defines
+=
%w(MRB_ENABLE_CXX_EXCEPTION MRB_ENABLE_CXX_ABI)
c
.
flags
<<
c
.
cxx_compile_flag
c
.
flags
.
delete
(
'-std=gnu99'
)
c
.
flags
=
c
.
flags
.
flatten
-
c
.
cxx_invalid_flags
.
flatten
}
linker
.
command
=
cxx
.
command
if
toolchains
.
find
{
|
v
|
v
==
'gcc'
}
@cxx_abi_enabled
=
true
...
...
lib/mruby/build/command.rb
View file @
be76cec3
...
...
@@ -41,7 +41,7 @@ module MRuby
class
Command::Compiler
<
Command
attr_accessor
:flags
,
:include_paths
,
:defines
,
:source_exts
attr_accessor
:compile_options
,
:option_define
,
:option_include_path
,
:out_ext
attr_accessor
:cxx_compile_flag
,
:cxx_exception_flag
attr_accessor
:cxx_compile_flag
,
:cxx_exception_flag
,
:cxx_invalid_flags
def
initialize
(
build
,
source_exts
=
[])
super
(
build
)
...
...
@@ -53,6 +53,7 @@ module MRuby
@option_include_path
=
'-I%s'
@option_define
=
'-D%s'
@compile_options
=
'%{flags} -o %{outfile} -c %{infile}'
@cxx_invalid_flags
=
[]
end
alias
header_search_paths
include_paths
...
...
tasks/toolchains/gcc.rake
View file @
be76cec3
MRuby
::
Toolchain
.
new
(
:gcc
)
do
|
conf
,
params
|
default_command
=
params
[
:default_command
]
||
'gcc'
compile_flags
=
%w(-g -O3 -Wall -Wundef -Werror-implicit-function-declaration)
compiler_flags
=
%w(-g -O3 -Wall -Wundef)
c_mandatory_flags
=
%w(-std=gnu99)
cxx_invalid_flags
=
%w(-Wdeclaration-after-statement -Werror-implicit-function-declaration)
[
conf
.
cc
,
conf
.
objc
,
conf
.
asm
,
conf
.
cxx
].
each
do
|
compiler
|
if
compiler
==
conf
.
cxx
compiler
.
command
=
ENV
[
'CXX'
]
||
default_command
.
sub
(
/cc|$/
,
'++'
)
compiler
.
flags
=
[
ENV
[
'CXXFLAGS'
]
||
ENV
[
'CFLAGS'
]
||
compile_flags
]
compiler
.
flags
=
[
ENV
[
'CXXFLAGS'
]
||
ENV
[
'CFLAGS'
]
||
compile
r
_flags
]
else
compiler
.
command
=
ENV
[
'CC'
]
||
default_command
compiler
.
flags
=
[
'-std=gnu99'
,
ENV
[
'CFLAGS'
]
||
[
compile_flags
,
%w(-Wdeclaration-after-statement
-Wwrite-strings)
]]
compiler
.
flags
=
[
c_mandatory_flags
,
ENV
[
'CFLAGS'
]
||
[
compiler_flags
,
cxx_invalid_flags
,
%w(
-Wwrite-strings)
]]
end
compiler
.
option_include_path
=
'-I%s'
compiler
.
option_define
=
'-D%s'
compiler
.
compile_options
=
'%{flags} -MMD -o %{outfile} -c %{infile}'
compiler
.
cxx_compile_flag
=
'-x c++ -std=c++03'
compiler
.
cxx_exception_flag
=
'-fexceptions'
compiler
.
cxx_invalid_flags
=
c_mandatory_flags
+
cxx_invalid_flags
end
conf
.
linker
do
|
linker
|
...
...
travis_config.rb
View file @
be76cec3
...
...
@@ -40,7 +40,7 @@ MRuby::Build.new('cxx_abi') do |conf|
toolchain
:gcc
conf
.
gembox
'full-core'
conf
.
cc
.
flags
+=
%w(-
Werror=declaration-after-statement -
fpermissive)
conf
.
cc
.
flags
+=
%w(-fpermissive)
conf
.
compilers
.
each
do
|
c
|
c
.
defines
+=
%w(MRB_GC_FIXED_ARENA)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment