forked from qt-creator/qt-creator
Help/litehtml: Fix submodule build on Windows with CMake
In debug mode. Mixing debug and release is not supported in all configurations, so just enable code optimization flags in debug. Change-Id: Iafa8c49825e02c35a9998bf84832710964ae7601 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -4,19 +4,17 @@ project(QLiteHtml)
|
|||||||
|
|
||||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/litehtml/CMakeLists.txt)
|
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/litehtml/CMakeLists.txt)
|
||||||
set(ORIG_FPIC ${CMAKE_POSITION_INDEPENDENT_CODE})
|
set(ORIG_FPIC ${CMAKE_POSITION_INDEPENDENT_CODE})
|
||||||
set(ORIG_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
|
||||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
|
||||||
else()
|
|
||||||
set(CMAKE_BUILD_TYPE "Release")
|
|
||||||
endif()
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(LITEHTML_UTF8 ON)
|
set(LITEHTML_UTF8 ON)
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
add_subdirectory(litehtml)
|
add_subdirectory(litehtml)
|
||||||
set(CMAKE_BUILD_TYPE ${ORIG_CMAKE_BUILD_TYPE})
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE "${ORIG_FPIC}")
|
set(CMAKE_POSITION_INDEPENDENT_CODE "${ORIG_FPIC}")
|
||||||
|
# force optimized litehtml even in debug
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
target_compile_options(gumbo PRIVATE -O2)
|
||||||
|
target_compile_options(litehtml PRIVATE -O2)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(litehtml REQUIRED)
|
find_package(litehtml REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user