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

Unified Diff: cmake/CMakeLists.txt

Issue 2009503002: CMake: control static/shared the normal CMake way. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: both, lpthread 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cmake/cmake_build » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmake/CMakeLists.txt
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index bdb5ecb640196429482ae4bd9bdd34db2fd6d32b..ed8ec67d8da3b428ae51ec7e264d32b4247cb717 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -244,15 +244,16 @@ endif()
if (WIN32)
list (APPEND libs FontSub.lib Usp10.lib)
+else()
+ list (APPEND libs pthread)
endif()
find_package(OpenGL REQUIRED)
list (APPEND libs ${OPENGL_LIBRARIES})
-# This is our main output, libskia.so.
-# We mostly build an .so here because it helps test we've linked everything,
-# not so much that we think Skia is a good candidate to ship as a shared library.
-add_library (skia SHARED ${srcs})
+# This is our main output, libskia.{a,so,dll,dylib,etc...}
+# You can control whether this is static or shared with BUILD_SHARED_LIBS.
+add_library (skia ${srcs})
target_compile_definitions(skia
PUBLIC ${public_defines}
@@ -274,9 +275,12 @@ else()
endif()
set_target_properties(skia PROPERTIES
- COMPILE_FLAGS ${cc_flags}
- CXX_VISIBILITY_PRESET hidden
- VISIBILITY_INLINES_HIDDEN true)
+ COMPILE_FLAGS ${cc_flags})
+if (BUILD_SHARED_LIBS)
+ set_target_properties(skia PROPERTIES
+ CXX_VISIBILITY_PRESET hidden
+ VISIBILITY_INLINES_HIDDEN true)
+endif()
# Experimental C API install:
file(GLOB c_headers "../include/c/*.h")
« no previous file with comments | « no previous file | cmake/cmake_build » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698