Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: cmake/CMakeLists.txt

Issue 1376923003: cmake tweaks (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Boilerplate. 1 # Boilerplate.
2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD. 2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD.
3 project (skimake) 3 project (skimake)
4 set (CMAKE_CXX_STANDARD 11) 4 set (CMAKE_CXX_STANDARD 11)
5 5
6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope rs. 6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope rs.
7 if (NOT CMAKE_BUILD_TYPE) 7 if (NOT CMAKE_BUILD_TYPE)
8 set (CMAKE_BUILD_TYPE Release) 8 set (CMAKE_BUILD_TYPE Release)
9 endif () 9 endif ()
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ../src/fonts/SkFontMgr_fontconfig.cpp 46 ../src/fonts/SkFontMgr_fontconfig.cpp
47 ../src/ports/SkFontConfigInterface_direct.cpp) 47 ../src/ports/SkFontConfigInterface_direct.cpp)
48 # Alternative font managers. 48 # Alternative font managers.
49 remove_srcs (../src/ports/SkFontMgr_custom*.cpp) 49 remove_srcs (../src/ports/SkFontMgr_custom*.cpp)
50 # Not actually used by Skia. 50 # Not actually used by Skia.
51 remove_srcs (../src/utils/SkThreadUtils_pthread_*.cpp) 51 remove_srcs (../src/utils/SkThreadUtils_pthread_*.cpp)
52 52
53 # Skia sure ships a lot of code no one uses. 53 # Skia sure ships a lot of code no one uses.
54 remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/ xml/*) 54 remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/ xml/*)
55 55
56 # Some files only contain code in Debug mode. This quiets down some linker warn ings.
57 if (NOT CMAKE_BUILD_TYPE STREQUAL Debug)
58 remove_srcs (../src/core/SkDebug.cpp ../src/utils/SkDumpCanvas.cpp)
59 endif()
60
61 # Remove OS-specific source files. 56 # Remove OS-specific source files.
62 if (NOT WIN32) 57 if (NOT WIN32)
63 remove_srcs(../src/*XPS* 58 remove_srcs(../src/*XPS*
64 ../src/*_win*.cpp 59 ../src/*_win*.cpp
65 ../src/gpu/gl/angle/* 60 ../src/gpu/gl/angle/*
66 ../src/ports/SkImageDecoder_WIC.cpp 61 ../src/ports/SkImageDecoder_WIC.cpp
67 ../src/utils/win/*) 62 ../src/utils/win/*)
68 endif() 63 endif()
69 if (APPLE OR NOT UNIX) 64 if (APPLE OR NOT UNIX)
70 remove_srcs(../src/gpu/gl/glx/* 65 remove_srcs(../src/gpu/gl/glx/*
71 ../src/images/SkImageDecoder_FactoryDefault.cpp 66 ../src/images/SkImageDecoder_FactoryDefault.cpp
72 ../src/ports/SkFontMgr_fontconfig*.cpp 67 ../src/ports/SkFontMgr_fontconfig*.cpp
73 ../src/*FreeType*) 68 ../src/*FreeType*)
74 endif() 69 endif()
75 if (NOT ANDROID) 70 if (NOT ANDROID)
76 remove_srcs(../src/*Hwui* ../src/*android*) 71 remove_srcs(../src/*Hwui* ../src/*android*)
77 endif() 72 endif()
78 if (NOT APPLE) 73 if (NOT APPLE)
79 remove_srcs(../src/*darwin* 74 remove_srcs(../src/*darwin*
80 ../src/ports/SkImageDecoder_CG.cpp 75 ../src/ports/SkImageDecoder_CG.cpp
81 ../src/utils/mac/* 76 ../src/utils/mac/*
82 ../src/*mac*) 77 ../src/*_mac*)
83 endif() 78 endif()
84 79
85 # Remove processor-specific source files. 80 # Remove processor-specific source files.
86 if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ARM) 81 if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ARM)
87 remove_srcs(../src/*arm* ../src/*ARM* ../src/*neon* ../src/*NEON*) 82 remove_srcs(../src/*arm* ../src/*ARM* ../src/*neon* ../src/*NEON*)
88 endif() 83 endif()
89 if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL MIPS) 84 if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL MIPS)
90 remove_srcs(../src/*mips* ../src/*MIPS*) 85 remove_srcs(../src/*mips* ../src/*MIPS*)
91 endif() 86 endif()
92 87
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 189
195 if (APPLE) 190 if (APPLE)
196 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) 191 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED)
197 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) 192 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK})
198 endif() 193 endif()
199 194
200 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) 195 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS)
201 list (APPEND libs ${OSMESA_LIBRARIES}) 196 list (APPEND libs ${OSMESA_LIBRARIES})
202 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) 197 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS})
203 list (APPEND public_defines "-DSK_MESA=1") 198 list (APPEND public_defines "-DSK_MESA=1")
204 message("-- Found OSMesa: " ${OSMESA_LIBRARIES})
205 else() 199 else()
206 remove_srcs(../src/gpu/gl/mesa/*) 200 remove_srcs(../src/gpu/gl/mesa/*)
207 message("-- Could NOT find OSMesa")
208 endif() 201 endif()
209 202
210 find_package(OpenGL REQUIRED) 203 find_package(OpenGL REQUIRED)
211 list (APPEND libs ${OPENGL_LIBRARIES}) 204 list (APPEND libs ${OPENGL_LIBRARIES})
212 205
213 # This is our main output, libskia.so. 206 # This is our main output, libskia.so.
214 # We mostly build an .so here because it helps test we've linked everything, 207 # We mostly build an .so here because it helps test we've linked everything,
215 # not so much that we think Skia is a good candidate to ship as a shared library . 208 # not so much that we think Skia is a good candidate to ship as a shared library .
216 add_library (skia SHARED ${srcs}) 209 add_library (skia SHARED ${srcs})
217 210
218 list (APPEND private_defines "-DSKIA_DLL") 211 list (APPEND private_defines "-DSKIA_DLL")
219 212
220 target_compile_definitions(skia 213 target_compile_definitions(skia
221 PUBLIC ${public_defines} 214 PUBLIC ${public_defines}
222 PRIVATE ${private_defines}) 215 PRIVATE ${private_defines})
223 216
224 target_include_directories(skia 217 target_include_directories(skia
225 PUBLIC ${public_includes} 218 PUBLIC ${public_includes}
226 PRIVATE ${private_includes}) 219 PRIVATE ${private_includes})
227 220
228 target_link_libraries(skia 221 target_link_libraries(skia
229 PUBLIC 222 PUBLIC
230 PRIVATE ${libs}) 223 PRIVATE ${libs})
231 224
232 225
233 set_target_properties(skia PROPERTIES 226 set_target_properties(skia PROPERTIES
234 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" 227 COMPILE_FLAGS "-w -fno-exceptions -fno-rtti"
235 CXX_VISIBILITY_PRESET hidden 228 CXX_VISIBILITY_PRESET hidden
236 VISIBILITY_INLINES_HIDDEN true) 229 VISIBILITY_INLINES_HIDDEN true)
237 230
238 # Experimental C API install: 231 # Experimental C API install:
239 file(GLOB cheaders "../include/c/*.h") 232 file(GLOB c_headers "../include/c/*.h")
240 install(FILES ${cheaders} DESTINATION include) 233 install(FILES ${c_headers} DESTINATION include)
241 install(TARGETS skia DESTINATION lib) 234 install(TARGETS skia DESTINATION lib)
242 235
243 # Now build a simple example app that uses Skia via libskia.so. 236 # Now build a simple example app that uses Skia via libskia.so.
244 add_executable(example example.cpp) 237 add_executable(example example.cpp)
245 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 238 target_link_libraries(example skia ${OPENGL_LIBRARIES})
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698