Skip to content

Commit

Permalink
Build function overwrite only on Windows and Mac.
Browse files Browse the repository at this point in the history
From: xhaakon

It is not used on GNU/Linux. This patch allows one to build GammaRay
also for other architectures than i386 and amd64.
  • Loading branch information
winterz committed Oct 15, 2012
1 parent 9e2dca3 commit 3ac4f6a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
15 changes: 10 additions & 5 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ set(gammaray_srcs
propertyeditor/propertypaletteeditor.cpp
propertyeditor/palettedialog.cpp

hooking/abstractfunctionoverwriter.cpp
hooking/functionoverwriterfactory.cpp
hooking/winfunctionoverwriter.cpp
hooking/unixfunctionoverwriter.cpp

tools/modelinspector/modeltester.cpp
tools/modelinspector/modelmodel.cpp
tools/modelinspector/modelcellmodel.cpp
Expand Down Expand Up @@ -107,6 +102,16 @@ set(gammaray_srcs
tools/styleinspector/dynamicproxystyle.cpp
)

if(WIN32 OR APPLE)
set(gammaray_srcs
${gammaray_srcs}
hooking/abstractfunctionoverwriter.cpp
hooking/functionoverwriterfactory.cpp
hooking/winfunctionoverwriter.cpp
hooking/unixfunctionoverwriter.cpp
)
endif()

if(HAVE_PRIVATE_QT_HEADERS)
set(gammaray_srcs
${gammaray_srcs}
Expand Down
2 changes: 1 addition & 1 deletion core/hooking/unixfunctionoverwriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ class UnixFunctionOverwriter : public AbstractFunctionOverwriter

}

#endif // Q_OS_WIN
#endif // !Q_OS_WIN

#endif // UNIXFUNCTIONOVERWRITER_H
2 changes: 2 additions & 0 deletions core/probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,7 @@ Q_DECL_EXPORT const char *myFlagLocation(const char *method)
}
#endif

#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
void overwriteQtFunctions()
{
functionsOverwritten = true;
Expand Down Expand Up @@ -748,6 +749,7 @@ void overwriteQtFunctions()
#endif
#endif
}
#endif

#ifdef Q_OS_WIN
extern "C" Q_DECL_EXPORT void gammaray_probe_inject();
Expand Down

0 comments on commit 3ac4f6a

Please sign in to comment.