diff options
author | 2016-05-24 11:23:23 -0700 | |
---|---|---|
committer | 2016-05-24 11:23:23 -0700 | |
commit | 5d04fda87747d82f4039cecf3e72b62ddf1ca76d (patch) | |
tree | 9e203e115d735b2ac9e8024e5fce3e975dd1f299 /cmake | |
parent | e077e0683a6fe79f71f3e3762edb259941431ada (diff) |
CMake: skia_link_arguments.txt repects BUILD_SHARED_LIBS
.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2007093002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Review-Url: https://codereview.chromium.org/2007093002
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CMakeLists.txt | 18 | ||||
-rw-r--r-- | cmake/README.md | 3 |
2 files changed, 17 insertions, 4 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index ed8ec67d8d..ef0856a3ea 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -302,9 +302,21 @@ configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h") # skia_link_arguments.txt set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) -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") +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}) + get_filename_component(lib_path ${lib} ABSOLUTE) + file (APPEND ${link_arguments} "${lib_path}\n") + else() + file (APPEND ${link_arguments} "-l${lib}\n") + endif() + endforeach() +endif() # skia_compile_arguments.txt set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt) diff --git a/cmake/README.md b/cmake/README.md index f8a54f33e7..5937560955 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -32,4 +32,5 @@ Currently maybe-kinda-working platforms * Configure with `cmake . -G "Visual Studio 14 2015"` . * Compile with `cmake --build . --config Release` . * Still has too many warnings. - * Poorly tested as yet.
\ No newline at end of file + * Poorly tested as yet. + |