Index: cmake/CMakeLists.txt |
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt |
index fcbce4ff5c76edda74704bb00ea7952908d75813..adc41501bd14eacd9442b78ec8a9744182c32bbb 100644 |
--- a/cmake/CMakeLists.txt |
+++ b/cmake/CMakeLists.txt |
@@ -216,6 +216,7 @@ if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) |
list (APPEND libs ${OSMESA_LIBRARIES}) |
list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) |
list (APPEND public_defines "-DSK_MESA=1") |
+ set (SK_MESA 1) |
else() |
remove_srcs(../src/gpu/gl/mesa/*) |
endif() |
@@ -261,21 +262,10 @@ install(FILES ${c_headers} DESTINATION include) |
install(TARGETS skia DESTINATION lib) |
# SkUserConfig.h |
-set (userconfig_path ${userconfig_directory}/SkUserConfig.h) |
-file(WRITE ${userconfig_path} "// SkUserConfig generated by CMake.\n") |
-file(APPEND ${userconfig_path} "#ifndef SkUserConfig_DEFINED\n") |
-file(APPEND ${userconfig_path} "#define SkUserConfig_DEFINED\n") |
if (CMAKE_BUILD_TYPE STREQUAL Release) |
- file(APPEND ${userconfig_path} "#define SK_RELEASE\n") |
- file(APPEND ${userconfig_path} "#undef SK_DEBUG\n") |
-else () |
- file(APPEND ${userconfig_path} "#define SK_DEBUG\n") |
- file(APPEND ${userconfig_path} "#undef SK_RELEASE\n") |
-endif () |
-if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) |
- file (APPEND ${userconfig_path} "#define SK_MESA 1\n") |
+ set (SK_RELEASE 1) |
endif() |
-file(APPEND ${userconfig_path} "#endif // SkUserConfig_DEFINED\n") |
+configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h") |
# skia_link_arguments.txt |
set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) |