Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
e7925279
Commit
e7925279
authored
Oct 16, 2012
by
Wayne Stambaugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only use -O1 GCC optimization level for versions 4.7 and above for now.
parent
2dc8c27e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
12 deletions
+33
-12
CMakeLists.txt
CMakeLists.txt
+33
-12
No files found.
CMakeLists.txt
View file @
e7925279
...
...
@@ -16,7 +16,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
# KiCad build options should be added below.
#
# If you add a new build option, please add it's state to the CopyVersionInfoToClipboard()
# function in common/basicframe.cpp so that build option settings can be include
e
d in bug
# function in common/basicframe.cpp so that build option settings can be included in bug
# reports.
#
...
...
@@ -103,6 +103,13 @@ endif( USE_PCBNEW_SEXPR_FILE_FORMAT AND NOT USE_PCBNEW_NANOMETRES )
#================================================
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
KICAD_GCC_RELEASE_BUILD_FLAGS
"-O2"
)
set
(
KICAD_GCC_RELEASE_DEBUG_FLAGS
""
)
execute_process
(
COMMAND
${
CMAKE_C_COMPILER
}
-dumpversion
OUTPUT_VARIABLE GCC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Added -Wno-narrowing on 10/7/12 to prevent a huge number of warnings when
# compiling with GCC 4.7. This appears to be caused by and int to unsigned
# conversion in the Boost polygon library. At some point in the future when
...
...
@@ -114,24 +121,40 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# the -O2 level with GCC 4.7 (works fine with with GCC 4.6).
# This lower optimization level does not have a significant change on the speed.
#
# As newer versions of GCC and/or Boost are released, this code needs reviewed to
# determine if the problems above have been fixed either in Boost or GCC.
if
(
GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7
)
set
(
KICAD_GCC_RELEASE_BUILD_FLAGS
"-Wno-narrowing -O1"
)
set
(
KICAD_GCC_DEBUG_BUILD_FLAGS
"-Wno-narrowing"
)
endif
()
if
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
message
(
STATUS
"Setting GCC version
${
GCC_VERSION
}
build flags
\"
${
KICAD_GCC_DEBUG_BUILD_FLAGS
}
\"
"
)
else
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
message
(
STATUS
"Setting GCC version
${
GCC_VERSION
}
build flags
\"
${
KICAD_GCC_RELEASE_BUILD_FLAGS
}
\"
"
)
endif
(
CMAKE_BUILD_TYPE STREQUAL Debug
)
if
(
WIN32
)
# under Windows/mingw, -fPIC option is enabled by default
# Set default flags for Release build.
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall
-Wno-narrowing -O1
-DNDEBUG"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall
-Wno-narrowing -O1
-DNDEBUG"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall
${
KICAD_GCC_RELEASE_BUILD_FLAGS
}
-DNDEBUG"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall
${
KICAD_GCC_RELEASE_BUILD_FLAGS
}
-DNDEBUG"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
# Set default flags for Debug build.
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall
-Wno-narrowing
-g3 -ggdb3 -DDEBUG"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall
-Wno-narrowing
-g3 -ggdb3 -DDEBUG"
)
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall
${
KICAD_GCC_DEBUG_BUILD_FLAGS
}
-g3 -ggdb3 -DDEBUG"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall
${
KICAD_GCC_DEBUG_BUILD_FLAGS
}
-g3 -ggdb3 -DDEBUG"
)
else
(
WIN32
)
# Set default flags for Release build.
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall
-O
1 -DNDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall
-O
1 -DNDEBUG -fPIC"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-Wall
${
KICAD_GCC_RELEASE_BUILD_FLAGS
}
1 -DNDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Wall
${
KICAD_GCC_RELEASE_BUILD_FLAGS
}
1 -DNDEBUG -fPIC"
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
# Set default flags for Debug build.
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall
-Wno-narrowing
-g3 -ggdb3 -DDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall
-Wno-narrowing
-g3 -ggdb3 -DDEBUG -fPIC"
)
set
(
CMAKE_C_FLAGS_DEBUG
"-Wall
${
KICAD_GCC_DEBUG_BUILD_FLAGS
}
-g3 -ggdb3 -DDEBUG -fPIC"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Wall
${
KICAD_GCC_DEBUG_BUILD_FLAGS
}
-g3 -ggdb3 -DDEBUG -fPIC"
)
endif
(
WIN32
)
endif
(
CMAKE_COMPILER_IS_GNUCXX
)
...
...
@@ -162,8 +185,6 @@ endif(KICAD_SCRIPTING_MODULES)
if
(
KICAD_SCRIPTING_WXPYTHON
)
add_definitions
(
-DKICAD_SCRIPTING_WXPYTHON
)
endif
(
KICAD_SCRIPTING_WXPYTHON
)
if
(
USE_WX_GRAPHICS_CONTEXT
)
...
...
@@ -171,7 +192,7 @@ if(USE_WX_GRAPHICS_CONTEXT)
endif
(
USE_WX_GRAPHICS_CONTEXT
)
# Allow user to override the default settings for adding images to menu items. By default
# images in menu items are enabled on all plaforms except OSX. This can be over ridden by
# images in menu items are enabled on all pla
t
forms except OSX. This can be over ridden by
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior.
if
(
NOT DEFINED USE_IMAGES_IN_MENUS
)
if
(
NOT APPLE
)
...
...
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