2010-11-17 05:49:11 +00:00
|
|
|
# Check that people use the good file
|
|
|
|
if(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
message(FATAL_ERROR "
|
|
|
|
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
|
|
|
|
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
|
|
|
|
endif(NOT TOP_CMAKE_WAS_SOURCED)
|
|
|
|
|
|
|
|
|
|
|
|
# library name
|
|
|
|
set(Output Utilities)
|
|
|
|
|
|
|
|
# set common flags
|
|
|
|
set(CommonFlags
|
|
|
|
-fno-strict-aliasing
|
2014-07-11 21:33:09 +00:00
|
|
|
)
|
2010-11-17 05:49:11 +00:00
|
|
|
|
|
|
|
# set optimization flags
|
|
|
|
set(OptimizationFlags
|
|
|
|
-falign-functions
|
|
|
|
-falign-jumps
|
|
|
|
-falign-labels
|
|
|
|
-falign-loops
|
|
|
|
-fcaller-saves
|
|
|
|
-fcprop-registers
|
|
|
|
-fcrossjumping
|
|
|
|
-fcse-follow-jumps
|
|
|
|
-fcse-skip-blocks
|
|
|
|
-fdefer-pop
|
|
|
|
-fdelete-null-pointer-checks
|
|
|
|
-fgcse
|
|
|
|
-fgcse-lm
|
|
|
|
-fif-conversion
|
|
|
|
-fif-conversion2
|
|
|
|
-fmerge-constants
|
|
|
|
-foptimize-sibling-calls
|
|
|
|
-fpeephole2
|
|
|
|
-fregmove
|
|
|
|
-freorder-blocks
|
|
|
|
-freorder-functions
|
|
|
|
-frerun-cse-after-loop
|
|
|
|
-fsched-interblock
|
|
|
|
-fsched-spec
|
|
|
|
-fstrict-overflow
|
|
|
|
-fthread-jumps
|
|
|
|
-ftree-ccp
|
|
|
|
-ftree-ch
|
|
|
|
-ftree-copyrename
|
|
|
|
-ftree-dce
|
|
|
|
-ftree-dominator-opts
|
|
|
|
-ftree-fre
|
|
|
|
-ftree-lrs
|
|
|
|
-ftree-pre
|
|
|
|
-ftree-sra
|
|
|
|
-ftree-ter
|
|
|
|
-ftree-vrp
|
|
|
|
-funit-at-a-time)
|
|
|
|
|
2014-07-12 16:52:27 +00:00
|
|
|
#Clang doesn't support a few common flags that GCC does.
|
|
|
|
if(NOT USE_CLANG)
|
2014-08-04 16:42:40 +00:00
|
|
|
set(UtilitiesFinalFlags
|
|
|
|
${UtilitiesFinalFlags}
|
|
|
|
${CommonFlags} -fno-guess-branch-probability -fno-dse -fno-tree-dse
|
|
|
|
)
|
2014-07-12 16:52:27 +00:00
|
|
|
endif(NOT USE_CLANG)
|
|
|
|
|
2010-11-17 05:49:11 +00:00
|
|
|
# Debug - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
# add defines
|
2014-08-04 16:42:40 +00:00
|
|
|
set(UtilitiesFinalFlags
|
|
|
|
${UtilitiesFinalFlags}
|
|
|
|
${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD
|
|
|
|
)
|
2010-11-17 05:49:11 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
|
|
|
|
|
|
|
# Devel - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
|
|
|
|
# add defines
|
2014-08-04 16:42:40 +00:00
|
|
|
set(UtilitiesFinalFlags
|
|
|
|
${UtilitiesFinalFlags}
|
|
|
|
${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD
|
|
|
|
)
|
2010-11-17 05:49:11 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
|
|
|
|
|
|
|
|
# Release - Build
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
|
|
|
# add defines
|
2014-08-04 16:42:40 +00:00
|
|
|
set(UtilitiesFinalFlags
|
|
|
|
${UtilitiesFinalFlags}
|
|
|
|
${CommonFlags} ${OptimizationFlags}
|
|
|
|
)
|
2010-11-17 05:49:11 +00:00
|
|
|
endif(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
|
|
|
|
|
|
# variable with all sources of this library
|
|
|
|
set(UtilitiesSources
|
|
|
|
../../include/Utilities/FixedPointTypes.inl
|
|
|
|
../../include/Utilities/EventSource.inl
|
|
|
|
../../include/Utilities/SafeArray.inl
|
|
|
|
../../include/Utilities/TlsVariable.inl
|
|
|
|
AlignedMalloc.cpp
|
|
|
|
CheckedStaticBox.cpp
|
|
|
|
Console.cpp
|
|
|
|
EventSource.cpp
|
|
|
|
Exceptions.cpp
|
|
|
|
FastFormatString.cpp
|
|
|
|
HashTools.cpp
|
|
|
|
IniInterface.cpp
|
|
|
|
Linux/LnxHostSys.cpp
|
|
|
|
Linux/LnxMisc.cpp
|
|
|
|
Linux/LnxThreads.cpp
|
|
|
|
Mutex.cpp
|
|
|
|
PathUtils.cpp
|
|
|
|
PrecompiledHeader.cpp
|
|
|
|
pxCheckBox.cpp
|
|
|
|
pxRadioPanel.cpp
|
|
|
|
pxStaticText.cpp
|
|
|
|
pxStreams.cpp
|
|
|
|
pxTranslate.cpp
|
|
|
|
pxWindowTextWriter.cpp
|
|
|
|
Semaphore.cpp
|
|
|
|
StringHelpers.cpp
|
|
|
|
ThreadingDialogs.cpp
|
|
|
|
ThreadTools.cpp
|
|
|
|
vssprintf.cpp
|
|
|
|
VirtualMemory.cpp
|
|
|
|
wxAppWithHelpers.cpp
|
|
|
|
wxGuiTools.cpp
|
|
|
|
wxHelpers.cpp
|
|
|
|
x86/MemcpyVibes.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
# variable with all headers of this library
|
|
|
|
set(UtilitiesHeaders
|
|
|
|
../../include/Utilities/Assertions.h
|
|
|
|
../../include/Utilities/CheckedStaticBox.h
|
|
|
|
../../include/Utilities/Console.h
|
|
|
|
../../include/Utilities/Dependencies.h
|
|
|
|
../../include/Utilities/EventSource.h
|
|
|
|
../../include/Utilities/Exceptions.h
|
|
|
|
../../include/Utilities/FixedPointTypes.h
|
|
|
|
../../include/Utilities/General.h
|
|
|
|
../../include/Utilities/HashMap.h
|
|
|
|
../../include/Utilities/lnx_memzero.h
|
|
|
|
../../include/Utilities/MemcpyFast.h
|
|
|
|
../../include/Utilities/MemsetFast.inl
|
|
|
|
../../include/Utilities/Path.h
|
|
|
|
../../include/Utilities/PageFaultSource.h
|
|
|
|
../../include/Utilities/pxCheckBox.h
|
2010-12-14 20:12:03 +00:00
|
|
|
../../include/Utilities/pxForwardDefs.h
|
2010-11-17 05:49:11 +00:00
|
|
|
../../include/Utilities/pxRadioPanel.h
|
|
|
|
../../include/Utilities/pxStaticText.h
|
|
|
|
../../include/Utilities/pxStreams.h
|
|
|
|
../../include/Utilities/RedtapeWindows.h
|
|
|
|
../../include/Utilities/SafeArray.h
|
|
|
|
../../include/Utilities/ScopedAlloc.h
|
|
|
|
../../include/Utilities/ScopedPtr.h
|
|
|
|
../../include/Utilities/ScopedPtrMT.h
|
|
|
|
../../include/Utilities/StringHelpers.h
|
|
|
|
../../include/Utilities/Threading.h
|
|
|
|
../../include/Utilities/ThreadingDialogs.h
|
|
|
|
../../include/Utilities/TraceLog.h
|
|
|
|
../../include/Utilities/wxAppWithHelpers.h
|
|
|
|
../../include/Utilities/wxBaseTools.h
|
|
|
|
../../include/Utilities/wxGuiTools.h
|
|
|
|
PrecompiledHeader.h)
|
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
set(UtilitiesFinalSources
|
|
|
|
${UtilitiesSources}
|
|
|
|
${UtilitiesHeaders}
|
|
|
|
)
|
2010-11-17 05:49:11 +00:00
|
|
|
|
2014-08-04 16:42:40 +00:00
|
|
|
set(UtilitiesFinalLibs
|
|
|
|
${wxWidgets_LIBRARIES}
|
|
|
|
)
|
2011-09-06 19:07:55 +00:00
|
|
|
|
2014-08-27 18:47:59 +00:00
|
|
|
add_pcsx2_lib(${Output} "${UtilitiesFinalSources}" "${UtilitiesFinalLibs}" "${UtilitiesFinalFlags}")
|