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

Side by Side Diff: cmake/CMakeLists.txt

Issue 1320443009: Cmake: fix to make linking work on Ubuntu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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.3) # The latest version as I write this. Ma y be too strict. 2 cmake_minimum_required (VERSION 3.3) # The latest version as I write this. Ma y be too strict.
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES) 189 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES)
190 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS}) 190 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS})
191 list (APPEND libs ${FONTCONFIG_LIBRARIES}) 191 list (APPEND libs ${FONTCONFIG_LIBRARIES})
192 endif() 192 endif()
193 193
194 if (APPLE) 194 if (APPLE)
195 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) 195 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED)
196 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) 196 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK})
197 endif() 197 endif()
198 198
199 find_package(OpenGL REQUIRED)
200 list (APPEND libs ${OPENGL_LIBRARIES})
201
199 # This is our main output, libskia.so. 202 # This is our main output, libskia.so.
200 # We mostly build an .so here because it helps test we've linked everything, 203 # We mostly build an .so here because it helps test we've linked everything,
201 # not so much that we think Skia is a good candidate to ship as a shared library . 204 # not so much that we think Skia is a good candidate to ship as a shared library .
202 add_library (skia SHARED ${srcs}) 205 add_library (skia SHARED ${srcs})
203 206
204 target_compile_definitions(skia 207 target_compile_definitions(skia
205 PUBLIC 208 PUBLIC
206 PRIVATE -DSKIA_DLL) 209 PRIVATE -DSKIA_DLL)
207 210
208 target_include_directories(skia 211 target_include_directories(skia
209 PUBLIC ${public_includes} 212 PUBLIC ${public_includes}
210 PRIVATE ${private_includes}) 213 PRIVATE ${private_includes})
211 214
212 target_link_libraries(skia 215 target_link_libraries(skia
213 PUBLIC 216 PUBLIC
214 PRIVATE ${libs}) 217 PRIVATE ${libs})
215 218
216 219
217 set_target_properties(skia PROPERTIES 220 set_target_properties(skia PROPERTIES
218 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations" 221 COMPILE_FLAGS "-fno-exceptions -fno-rtti -Wno-deprecated-declarations"
219 CXX_VISIBILITY_PRESET hidden 222 CXX_VISIBILITY_PRESET hidden
220 VISIBILITY_INLINES_HIDDEN true) 223 VISIBILITY_INLINES_HIDDEN true)
221 224
222 # Now build a simple example app that uses Skia via libskia.so. 225 # Now build a simple example app that uses Skia via libskia.so.
223 find_package(OpenGL REQUIRED)
224 add_executable(example example.cpp) 226 add_executable(example example.cpp)
225 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 227 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