Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
e41d291a
Commit
e41d291a
authored
Jul 25, 2015
by
Chris Toshok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
separate out PGO and LTO flags, so they can be enabled independently
parent
e94e3d15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
CMakeLists.txt
CMakeLists.txt
+18
-17
No files found.
CMakeLists.txt
View file @
e41d291a
...
...
@@ -30,7 +30,7 @@ option(ENABLE_SELF_HOST "use pyston to test pyston" OFF)
option
(
ENABLE_VALGRIND
"pyston valgrind support"
OFF
)
option
(
ENABLE_PGO
"enable -fprofile-generate/-fprofile-use"
OFF
)
option
(
ENABLE_LTO
"enable -flto
(only if ENABLE_PGO=ON as well)
"
OFF
)
option
(
ENABLE_LTO
"enable -flto"
OFF
)
# automatically use ccache if found
if
(
ENABLE_CCACHE AND NOT ENABLE_PGO
)
...
...
@@ -74,26 +74,29 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
CLANG_FLAGS
}
"
)
endif
()
macro
(
ADD_PROFILE_FLAGS
)
if
(
ENABLE_LTO
)
set
(
LTO_FLAGS
"-flto"
)
endif
()
if
(
ENABLE_LTO
)
set
(
LTO_FLAGS
"-flto"
)
endif
()
if
(
ENABLE_PGO
)
if
(
NOT
"
${
PROFILE_DIR
}
"
STREQUAL
""
)
set
(
PROFILE_STATE
"
${
PROFILE_STATE
}
=
${
PROFILE_DIR
}
"
)
endif
()
set
(
PROFILE_C_FLAGS
"-fprofile-
${
PROFILE_STATE
}
${
LTO_FLAGS
}
-fprofile-correction"
)
set
(
PROFILE_CXX_FLAGS
"-fprofile-
${
PROFILE_STATE
}
${
LTO_FLAGS
}
-fprofile-correction"
)
set
(
PROFILE_LINK_FLAGS
"-fprofile-
${
PROFILE_STATE
}
${
LTO_FLAGS
}
-fprofile-correction"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
PROFILE_CXX_FLAGS
}
${
LTO_FLAGS
}
"
)
set
(
PGO_FLAGS
"-fprofile-
${
PROFILE_STATE
}
-fprofile-correction"
)
endif
()
macro
(
ADD_PROFILE_FLAGS
)
set
(
PROFILE_FLAGS
"
${
PGO_FLAGS
}
${
LTO_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
PROFILE_FLAGS
}
"
)
endmacro
()
# used in src/runtime/inline/CMakeLists.txt to remove the flags we added above
macro
(
REMOVE_PROFILE_FLAGS
)
string
(
REPLACE
"
${
PROFILE_
C_FLAGS
}
"
"
"
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
CXX_FLAGS
}
"
"
"
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
CXX_FLAGS
}
"
"
"
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
string
(
REPLACE
"
${
PROFILE_
CXX_FLAGS
}
"
"
"
CMAKE_CXX_LINK_FLAGS
"
${
CMAKE_CXX_LINK_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
CXX_FLAGS
}
"
"
"
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
FLAGS
}
"
"
"
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
FLAGS
}
"
"
"
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
FLAGS
}
"
"
"
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
string
(
REPLACE
"
${
PROFILE_
FLAGS
}
"
"
"
CMAKE_CXX_LINK_FLAGS
"
${
CMAKE_CXX_LINK_FLAGS
}
"
)
string
(
REPLACE
"
${
PROFILE_
FLAGS
}
"
"
"
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
"
)
endmacro
()
# llvm disable debug info unless ENABLE_LLVM_DEBUG is ON
...
...
@@ -243,9 +246,7 @@ find_package(LibLZMA REQUIRED)
link_directories
(
${
CMAKE_BINARY_DIR
}
/libunwind/lib
)
link_directories
(
${
LLVM_LIBRARY_DIRS
}
)
if
(
${
CMAKE_BUILD_TYPE
}
STREQUAL
"Release"
AND ENABLE_PGO
)
ADD_PROFILE_FLAGS
()
endif
()
ADD_PROFILE_FLAGS
()
add_subdirectory
(
lib_pyston
)
add_subdirectory
(
from_cpython
)
...
...
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