all repos — mgba @ 94fc963c89460a508e6c569aadaf715981768fa1

mGBA Game Boy Advance Emulator

CMake: Fix PGO on non-GNU platforms
Vicki Pfau vi@endrift.com
Wed, 09 Sep 2020 19:57:41 -0700
commit

94fc963c89460a508e6c569aadaf715981768fa1

parent

11f105eec78e2744ccd20554171c7e0f7794ba14

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M CMakeLists.txtCMakeLists.txt

@@ -166,6 +166,10 @@ mark_as_advanced(BUILD_LTO BUILD_PGO PGO_STAGE_2 PGO_DIR)

set(PGO_PRE_FLAGS "-fprofile-generate=${PGO_DIR} -fprofile-arcs") set(PGO_POST_FLAGS "-fprofile-use=${PGO_DIR} -fbranch-probabilities") +if(BUILD_PGO AND CMAKE_SYSTEM_NAME STREQUAL "Generic") + add_definitions(-DTARGET_POSIX_IO) +endif() + if(BUILD_PGO AND NOT PGO_STAGE_2) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${PGO_PRE_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${PGO_PRE_FLAGS}")