|
|
DescriptionCMake: control static/shared the normal CMake way.
This flips the default build mode to create a static libskia.
To create a shared libskia, pass -DBUILD_SHARED_LIBS=1 when running cmake.
BUG=skia:5341
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2009503002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Committed: https://skia.googlesource.com/skia/+/7dd44673e0d8f803f293ded4bc4f7d6a55d460dd
Patch Set 1 #Patch Set 2 : both, lpthread #
Total comments: 3
Messages
Total messages: 29 (10 generated)
Description was changed from ========== CMake: control static/shared the normal CMake way. This flips the default build mode to create a static libskia. To create a shared libskia, pass -DBUILD_SHARED_LIBS=1 when running cmake. BUG=skia:5341 ========== to ========== CMake: control static/shared the normal CMake way. This flips the default build mode to create a static libskia. To create a shared libskia, pass -DBUILD_SHARED_LIBS=1 when running cmake. BUG=skia:5341 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2009503002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot ==========
The CQ bit was checked by mtklein@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2009503002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2009503002/1
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-x86...)
mtklein@chromium.org changed reviewers: + halcanary@google.com, stephana@google.com - mtklein@google.com
The CQ bit was checked by mtklein@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2009503002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2009503002/20001
Note for Reviewers: The CQ is waiting for an approval. If you believe that the CL is not ready yet, or if you would like to L-G-T-M with comments then please uncheck the CQ checkbox. Waiting for LGTM from valid reviewer(s) till 2016-05-24 20:37 UTC
halcanary@google.com changed reviewers: + jcgregorio@google.com
Will this break fiddle? https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt File cmake/CMakeLists.txt (right): https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt#ne... cmake/CMakeLists.txt:303: # skia_link_arguments.txt Should this change depending on static/shared?
mtklein@google.com changed reviewers: + mtklein@google.com
I don't know. Where's the fiddle try bot?
On 2016/05/24 at 14:47:14, mtklein wrote: > I don't know. Where's the fiddle try bot? As long as the @skia_compile_arguments.txt and @skia_link_arguments.txt files are up to date then this shouldn't affect fiddle. Also, fiddle_main.cpp is built as part of 'tools' target afaik, so it should be covered by the trybots.
https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt File cmake/CMakeLists.txt (right): https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt#ne... cmake/CMakeLists.txt:303: # skia_link_arguments.txt On 2016/05/24 14:44:51, Hal Canary wrote: > Should this change depending on static/shared? Something like this? if (BUILD_SHARED_LIBS) file (APPEND ${link_arguments} "$<TARGET_FILE:skia>\n") else() file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") file (APPEND ${link_arguments} "-lskia\n") file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") endif()
https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt File cmake/CMakeLists.txt (right): https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt#ne... cmake/CMakeLists.txt:303: # skia_link_arguments.txt On 2016/05/24 14:44:51, Hal Canary wrote: > Should this change depending on static/shared? Something like this? if (BUILD_SHARED_LIBS) file (APPEND ${link_arguments} "$<TARGET_FILE:skia>\n") else() file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") file (APPEND ${link_arguments} "-lskia\n") file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") endif()
https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt File cmake/CMakeLists.txt (right): https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt#ne... cmake/CMakeLists.txt:303: # skia_link_arguments.txt This seems to work, even if it is hacky: # skia_link_arguments.txt set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) if (BUILD_SHARED_LIBS) file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") file (APPEND ${link_arguments} "-lskia\n") file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") else() file (WRITE ${link_arguments} "${CMAKE_BINARY_DIR}/libskia.a\n") foreach (lib ${libs}) if (${lib} STREQUAL "pthread") file (APPEND ${link_arguments} "-l${lib}\n") else() file (APPEND ${link_arguments} "${lib}\n") endif() endforeach() endif()
On 2016/05/24 15:44:45, Hal Canary wrote: > https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt > File cmake/CMakeLists.txt (right): > > https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt#ne... > cmake/CMakeLists.txt:303: # skia_link_arguments.txt > This seems to work, even if it is hacky: > > # skia_link_arguments.txt > set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) > if (BUILD_SHARED_LIBS) > file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") > file (APPEND ${link_arguments} "-lskia\n") > file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") > else() > file (WRITE ${link_arguments} "${CMAKE_BINARY_DIR}/libskia.a\n") > foreach (lib ${libs}) > if (${lib} STREQUAL "pthread") > file (APPEND ${link_arguments} "-l${lib}\n") > else() > file (APPEND ${link_arguments} "${lib}\n") > endif() > endforeach() > endif() Can we not just change fiddle to explicitly ask for a shared library? Or would you prefer a static link there?
On 2016/05/24 16:01:37, mtklein wrote: > On 2016/05/24 15:44:45, Hal Canary wrote: > > https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt > > File cmake/CMakeLists.txt (right): > > > > > https://codereview.chromium.org/2009503002/diff/20001/cmake/CMakeLists.txt#ne... > > cmake/CMakeLists.txt:303: # skia_link_arguments.txt > > This seems to work, even if it is hacky: > > > > # skia_link_arguments.txt > > set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) > > if (BUILD_SHARED_LIBS) > > file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") > > file (APPEND ${link_arguments} "-lskia\n") > > file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") > > else() > > file (WRITE ${link_arguments} "${CMAKE_BINARY_DIR}/libskia.a\n") > > foreach (lib ${libs}) > > if (${lib} STREQUAL "pthread") > > file (APPEND ${link_arguments} "-l${lib}\n") > > else() > > file (APPEND ${link_arguments} "${lib}\n") > > endif() > > endforeach() > > endif() > > Can we not just change fiddle to explicitly ask for a shared library? Or would > you prefer a static link there? I have no preference on static vs shared. Whichever is faster to compile and run, I suppose. Either way, I think `skia_link_arguments.txt` is spiffy and should just work. Think of it as autogenerated machine-specific documentation.
Add this: # skia_link_arguments.txt set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) if (BUILD_SHARED_LIBS) file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") file (APPEND ${link_arguments} "-lskia\n") file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") else() file (WRITE ${link_arguments} "${CMAKE_BINARY_DIR}/libskia.a\n") foreach (lib ${libs}) if (EXISTS ${lib}) file (APPEND ${link_arguments} "${lib}\n") else() file (APPEND ${link_arguments} "-l${lib}\n") endif() endforeach() endif() and I will 1GTM this CL.
I think I'd like to factor myself out of caring about fiddle. Please take a look at PS3, which leaves fiddle unchanged.
Patchset #3 (id:40001) has been deleted
I have deleted PS 3.
lgtm
The CQ bit was checked by mtklein@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2009503002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2009503002/20001
Message was sent while issue was closed.
Description was changed from ========== CMake: control static/shared the normal CMake way. This flips the default build mode to create a static libskia. To create a shared libskia, pass -DBUILD_SHARED_LIBS=1 when running cmake. BUG=skia:5341 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2009503002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot ========== to ========== CMake: control static/shared the normal CMake way. This flips the default build mode to create a static libskia. To create a shared libskia, pass -DBUILD_SHARED_LIBS=1 when running cmake. BUG=skia:5341 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2009503002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Committed: https://skia.googlesource.com/skia/+/7dd44673e0d8f803f293ded4bc4f7d6a55d460dd ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/7dd44673e0d8f803f293ded4bc4f7d6a55d460dd |