/[pcsx2_0.9.7]/trunk/common/src/Utilities/CMakeLists.txt
ViewVC logotype

Diff of /trunk/common/src/Utilities/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by william, Tue Sep 7 03:24:11 2010 UTC revision 62 by william, Tue Sep 7 11:08:22 2010 UTC
# Line 1  Line 1 
1  # Utilities library  # Check that people use the good file
2    if(NOT TOP_CMAKE_WAS_SOURCED)
3  # library name      message(FATAL_ERROR "
4  set(UtilitiesName Utilities)      You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
5        It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
6  # Clear default flags  endif(NOT TOP_CMAKE_WAS_SOURCED)
7  set(CMAKE_C_FLAGS "")  
8  set(CMAKE_CXX_FLAGS "")  
9  set(CMAKE_C_FLAGS_DEBUG "")  # library name
10  set(CMAKE_CXX_FLAGS_DEBUG "")  set(Output Utilities)
11  set(CMAKE_C_FLAGS_DEVEL "")  
12  set(CMAKE_CXX_FLAGS_DEVEL "")  # set common flags
13  set(CMAKE_C_FLAGS_RELEASE "")  set(CommonFlags
14  set(CMAKE_CXX_FLAGS_RELEASE "")          -pthread
15        -fvisibility=hidden
16  # set common flags          -fno-dse
 set(CommonFlags  
         -pthread  
         -m32  
         -march=i486  
         -msse  
         -msse2  
         -fno-dse  
17          -fno-guess-branch-probability          -fno-guess-branch-probability
18          -fno-strict-aliasing          -fno-strict-aliasing
19          -fno-tree-dse          -fno-tree-dse
20          -pipe          -pipe
21          -Wno-format          -Wno-format
22          -Wno-unused-parameter          -Wno-unused-parameter
23          -Wno-unused-value          -Wno-unused-value
24          -Wunused-variable)          -Wunused-variable)
25    
26  # set warning flags  # set warning flags
27  set(DebugFlags  set(DebugFlags
28          -g          -g
29          -W)          -W)
30    
31  # set optimization flags  # set optimization flags
32  set(OptimizationFlags  set(OptimizationFlags
33          -falign-functions          -falign-functions
34          -falign-jumps          -falign-jumps
35          -falign-labels          -falign-labels
36          -falign-loops          -falign-loops
37          -fcaller-saves          -fcaller-saves
38          -fcprop-registers          -fcprop-registers
39          -fcrossjumping          -fcrossjumping
40          -fcse-follow-jumps          -fcse-follow-jumps
41          -fcse-skip-blocks          -fcse-skip-blocks
42          -fdefer-pop          -fdefer-pop
43          -fdelete-null-pointer-checks          -fdelete-null-pointer-checks
44          -fgcse          -fgcse
45          -fgcse-lm          -fgcse-lm
46          -fif-conversion          -fif-conversion
47          -fif-conversion2          -fif-conversion2
48          -fmerge-constants          -fmerge-constants
49          -foptimize-sibling-calls          -foptimize-sibling-calls
50          -fpeephole2          -fpeephole2
51          -fregmove          -fregmove
52          -freorder-blocks          -freorder-blocks
53          -freorder-functions          -freorder-functions
54          -frerun-cse-after-loop          -frerun-cse-after-loop
55          -fsched-interblock          -fsched-interblock
56          -fsched-spec          -fsched-spec
57          -fstrict-overflow          -fstrict-overflow
58          -fthread-jumps          -fthread-jumps
59          -ftree-ccp          -ftree-ccp
60          -ftree-ch          -ftree-ch
61          -ftree-copyrename          -ftree-copyrename
62          -ftree-dce          -ftree-dce
63          -ftree-dominator-opts          -ftree-dominator-opts
64          -ftree-fre          -ftree-fre
65          -ftree-lrs          -ftree-lrs
66          -ftree-pre          -ftree-pre
67          -ftree-sra          -ftree-sra
68          -ftree-ter          -ftree-ter
69          -ftree-vrp          -ftree-vrp
70          -funit-at-a-time)          -funit-at-a-time)
71    
72  # Debug - Build  # Debug - Build
73  if(CMAKE_BUILD_TYPE STREQUAL Debug)  if(CMAKE_BUILD_TYPE STREQUAL Debug)
74                    
75          # add defines          # add defines
76          add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)          add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)
77  endif(CMAKE_BUILD_TYPE STREQUAL Debug)  endif(CMAKE_BUILD_TYPE STREQUAL Debug)
78    
79  # Devel - Build  # Devel - Build
80  if(CMAKE_BUILD_TYPE STREQUAL Devel)  if(CMAKE_BUILD_TYPE STREQUAL Devel)
81                    
82          # add defines          # add defines
83          add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD)          add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD)
84  endif(CMAKE_BUILD_TYPE STREQUAL Devel)  endif(CMAKE_BUILD_TYPE STREQUAL Devel)
85    
86  # Release - Build  # Release - Build
87  if(CMAKE_BUILD_TYPE STREQUAL Release)  if(CMAKE_BUILD_TYPE STREQUAL Release)
88                    
89          # add defines          # add defines
90          add_definitions(${CommonFlags} ${OptimizationFlags})          add_definitions(${CommonFlags} ${OptimizationFlags})
91  endif(CMAKE_BUILD_TYPE STREQUAL Release)  endif(CMAKE_BUILD_TYPE STREQUAL Release)
92    
93  # variable with all sources of this library  # variable with all sources of this library
94  set(UtilitiesSources  set(UtilitiesSources
95          ../../include/Utilities/EventSource.inl          ../../include/Utilities/FixedPointTypes.inl
96          AlignedMalloc.cpp          ../../include/Utilities/EventSource.inl
97          CheckedStaticBox.cpp      ../../include/Utilities/SafeArray.inl
98          Console.cpp      ../../include/Utilities/TlsVariable.inl
99          EventSource.cpp          AlignedMalloc.cpp
100          Exceptions.cpp          CheckedStaticBox.cpp
101          FastFormatString.cpp          Console.cpp
102          HashTools.cpp          EventSource.cpp
103          Linux/LnxHostSys.cpp          Exceptions.cpp
104          Linux/LnxMisc.cpp          FastFormatString.cpp
105          Linux/LnxThreads.cpp          HashTools.cpp
106          Mutex.cpp          IniInterface.cpp
107          PathUtils.cpp          Linux/LnxHostSys.cpp
108          PrecompiledHeader.cpp          Linux/LnxMisc.cpp
109          pxCheckBox.cpp          Linux/LnxThreads.cpp
110          pxRadioPanel.cpp          Mutex.cpp
111          pxStaticText.cpp          PathUtils.cpp
112          pxWindowTextWriter.cpp          PrecompiledHeader.cpp
113          Semaphore.cpp          pxCheckBox.cpp
114          StringHelpers.cpp          pxRadioPanel.cpp
115          ThreadingDialogs.cpp          pxStaticText.cpp
116          ThreadTools.cpp          pxTextStream.cpp
117          vssprintf.cpp          pxTranslate.cpp
118          wxAppWithHelpers.cpp          pxWindowTextWriter.cpp
119          wxGuiTools.cpp          Semaphore.cpp
120          wxHelpers.cpp          StringHelpers.cpp
121  #       x86/MemcpyFast.cpp          ThreadingDialogs.cpp
122          )          ThreadTools.cpp
123            vssprintf.cpp
124  # collect .S files          wxAppWithHelpers.cpp
125  set(UtilitiesSSources          wxGuiTools.cpp
126          x86/MemcpyFast.S)          wxHelpers.cpp
127            x86/MemcpyVibes.cpp
128  # variable with all headers of this library  #       x86/MemcpyFast.cpp
129  set(UtilitiesHeaders          )
130          ../../include/Utilities/Assertions.h  
131          ../../include/Utilities/CheckedStaticBox.h  # collect .S files
132          ../../include/Utilities/Console.h  set(UtilitiesSSources
133          ../../include/Utilities/Dependencies.h          x86/MemcpyFast.S)
134          ../../include/Utilities/EventSource.h  
135          ../../include/Utilities/Exceptions.h  # variable with all headers of this library
136          ../../include/Utilities/FixedPointTypes.h  set(UtilitiesHeaders
137          ../../include/Utilities/General.h          ../../include/Utilities/Assertions.h
138          ../../include/Utilities/HashMap.h          ../../include/Utilities/CheckedStaticBox.h
139          ../../include/Utilities/lnx_memzero.h          ../../include/Utilities/Console.h
140          ../../include/Utilities/MemcpyFast.h          ../../include/Utilities/Dependencies.h
141          ../../include/Utilities/Path.h          ../../include/Utilities/EventSource.h
142          ../../include/Utilities/pxCheckBox.h          ../../include/Utilities/Exceptions.h
143          ../../include/Utilities/pxRadioPanel.h          ../../include/Utilities/FixedPointTypes.h
144          ../../include/Utilities/pxStaticText.h          ../../include/Utilities/General.h
145          ../../include/Utilities/RedtapeWindows.h          ../../include/Utilities/HashMap.h
146          ../../include/Utilities/SafeArray.h          ../../include/Utilities/lnx_memzero.h
147          ../../include/Utilities/ScopedPtr.h          ../../include/Utilities/MemcpyFast.h
148          ../../include/Utilities/ScopedPtrMT.h          ../../include/Utilities/Path.h
149          ../../include/Utilities/StringHelpers.h          ../../include/Utilities/pxCheckBox.h
150          ../../include/Utilities/Threading.h          ../../include/Utilities/pxRadioPanel.h
151          ../../include/Utilities/ThreadingDialogs.h          ../../include/Utilities/pxStaticText.h
152          ../../include/Utilities/wxAppWithHelpers.h          ../../include/Utilities/RedtapeWindows.h
153          ../../include/Utilities/wxBaseTools.h          ../../include/Utilities/SafeArray.h
154          ../../include/Utilities/wxGuiTools.h          ../../include/Utilities/ScopedPtr.h
155          PrecompiledHeader.h)          ../../include/Utilities/ScopedPtrMT.h
156            ../../include/Utilities/StringHelpers.h
157  # change language of .S-files to c++          ../../include/Utilities/Threading.h
158  set_source_files_properties(${UtilitiesSSources} PROPERTIES LANGUAGE CXX)          ../../include/Utilities/ThreadingDialogs.h
159            ../../include/Utilities/TraceLog.h
160  # add library          ../../include/Utilities/wxAppWithHelpers.h
161  add_library(${UtilitiesName} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${UtilitiesSSources})          ../../include/Utilities/wxBaseTools.h
162            ../../include/Utilities/wxGuiTools.h
163  # link target with wx          PrecompiledHeader.h)
164  target_link_libraries(${UtilitiesName} ${wxWidgets_LIBRARIES})  
165    include_directories(.)
166  # Force the linker into 32 bits mode  
167  target_link_libraries(${UtilitiesName} -m32)  # change language of .S-files to c++
168    set_source_files_properties(${UtilitiesSSources} PROPERTIES LANGUAGE CXX)
169  # Linker strip option  
170  if (CMAKE_BUILD_STRIP)  # add library
171      target_link_libraries(${UtilitiesName} -s)  add_library(${Output} STATIC ${UtilitiesSources} ${UtilitiesHeaders} ${UtilitiesSSources})
172  endif (CMAKE_BUILD_STRIP)  
173    # link target with wx
174    target_link_libraries(${Output} ${wxWidgets_LIBRARIES})
175    
176    # User flags options
177    if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
178        target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}")
179    endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")

Legend:
Removed from v.31  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22