Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.extension
Commits
9fa628d7
Commit
9fa628d7
authored
Sep 26, 2014
by
Manuel Günther
Browse files
Added default compile flags to be RELEASE flags.
parent
1cc7229b
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/extension/cmake.py
View file @
9fa628d7
...
...
@@ -3,7 +3,7 @@ import os
HEADER
=
(
'
\n
'
'# For both C and C++
\n
'
'set(COMMON_FLAGS "-pedantic -Wall
$ENV{CFLAGS}
")
\n
'
'set(COMMON_FLAGS "-pedantic -Wall")
\n
'
'if (WIN32)
\n
'
' set(COMMON_FLAGS "-D_WIN32_WINNT=0x501") # Set min. Windows version to XP
\n
'
'else(WIN32)
\n
'
...
...
@@ -94,6 +94,12 @@ class CMakeListsGenerator:
def
generate
(
self
,
directory
):
"""Generates the CMakeLists.txt file in the given directory."""
# check if CFLAGS or CXXFLAGS are set, and set them if not
if
'CFLAGS'
not
in
os
.
environ
:
os
.
environ
[
'CFLAGS'
]
=
'-O3 -g0 -DNDEBUG -mtune=generic'
if
'CXXFLAGS'
not
in
os
.
environ
:
os
.
environ
[
'CXXFLAGS'
]
=
'-O3 -g0 -DNDEBUG -mtune=generic'
filename
=
os
.
path
.
join
(
directory
,
"CMakeLists.txt"
)
with
open
(
filename
,
'w'
)
as
f
:
f
.
write
(
'# WARNING! This file is automatically generated. Do not change its contents.
\n\n
'
)
...
...
Write
Preview
Supports
Markdown
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