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

Side by Side Diff: cmake/CMakeLists.txt

Issue 2007093002: CMake: skia_link_arguments.txt repects BUILD_SHARED_LIBS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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 | cmake/README.md » ('j') | 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 endif() 295 endif()
296 if (UNIX AND NOT APPLE) 296 if (UNIX AND NOT APPLE)
297 set (SK_SAMPLES_FOR_X 1) 297 set (SK_SAMPLES_FOR_X 1)
298 else() 298 else()
299 set (SK_SAMPLES_FOR_X 0) 299 set (SK_SAMPLES_FOR_X 0)
300 endif() 300 endif()
301 configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h") 301 configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h")
302 302
303 # skia_link_arguments.txt 303 # skia_link_arguments.txt
304 set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) 304 set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt)
305 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") 305 if (BUILD_SHARED_LIBS)
306 file (APPEND ${link_arguments} "-lskia\n") 306 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n")
307 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") 307 file (APPEND ${link_arguments} "-lskia\n")
308 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n")
309 else()
310 file (WRITE ${link_arguments} "${CMAKE_BINARY_DIR}/libskia.a\n")
311 foreach (lib ${libs})
312 if (EXISTS ${lib})
313 get_filename_component(lib_path ${lib} ABSOLUTE)
314 file (APPEND ${link_arguments} "${lib_path}\n")
315 else()
316 file (APPEND ${link_arguments} "-l${lib}\n")
317 endif()
318 endforeach()
319 endif()
308 320
309 # skia_compile_arguments.txt 321 # skia_compile_arguments.txt
310 set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt) 322 set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt)
311 file (WRITE ${compile_arguments} "--std=c++11\n") 323 file (WRITE ${compile_arguments} "--std=c++11\n")
312 foreach (include ${public_includes}) 324 foreach (include ${public_includes})
313 get_filename_component (abs_include ${include} ABSOLUTE) 325 get_filename_component (abs_include ${include} ABSOLUTE)
314 file (APPEND ${compile_arguments} "-I${abs_include}\n") 326 file (APPEND ${compile_arguments} "-I${abs_include}\n")
315 endforeach() 327 endforeach()
316 328
317 # cmake . 329 # cmake .
(...skipping 18 matching lines...) Expand all
336 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") 348 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n")
337 endif () 349 endif ()
338 endforeach() 350 endforeach()
339 endif() 351 endif()
340 endforeach() 352 endforeach()
341 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") 353 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n")
342 354
343 # Now build a simple example app that uses Skia via libskia.so. 355 # Now build a simple example app that uses Skia via libskia.so.
344 add_executable(example example.cpp) 356 add_executable(example example.cpp)
345 target_link_libraries(example skia ${OPENGL_LIBRARIES}) 357 target_link_libraries(example skia ${OPENGL_LIBRARIES})
OLDNEW
« no previous file with comments | « no previous file | cmake/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698