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

Unified Diff: cmake/CMakeLists.txt

Issue 1544493002: CMake: generate SkUserConfig.h with configure_file (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: dont need else Created 5 years 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/SkUserConfig.h.in » ('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 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)
« no previous file with comments | « no previous file | cmake/SkUserConfig.h.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698