@@ -103,26 +103,6 @@ if(${CMAKE_VERSION} GREATER "3.12")
103103 cmake_policy (SET CMP0077 NEW )
104104endif ()
105105
106- if (OS_WINDOWS)
107- add_link_options (/DEBUG )
108-
109- if (USE_SANDBOX)
110- # cef_sandbox.lib is MT already, must keep the same with it
111- set (CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Use static runtime" )
112- add_compile_options ("/MT$<$<CONFIG :Debug >:d >" )
113- else ()
114- # either MT or MD is supported
115- set (CEF_RUNTIME_LIBRARY_FLAG "/M$<IF :$<BOOL :${STATIC_CRT} >,T ,D >" CACHE STRING "Use static runtime" FORCE )
116- add_compile_options ("/M$<IF :$<BOOL :${STATIC_CRT} >,T ,D >$<$<CONFIG :Debug >:d >" )
117- endif ()
118- else ()
119- add_compile_options (
120- "-g"
121- "$<$<CONFIG :DEBUG >:-O0 >"
122- "$<$<CONFIG :RELEASE >:-O3 >"
123- )
124- endif ()
125-
126106# Append CEF root dir to CMAKE_MODULE_PATH
127107set (CEF_ROOT "${CEF_SDK_DIR} " )
128108list (APPEND CMAKE_MODULE_PATH "${CEF_ROOT} /cmake" )
@@ -131,14 +111,6 @@ find_package(CEF REQUIRED)
131111# Add libcef dll wrapper
132112add_subdirectory (${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper )
133113
134- if (USE_SANDBOX AND (OS_WINDOWS OR OS_MACOS))
135- add_definitions (-DCEF_USE_SANDBOX )
136-
137- # message(STATUS "cef_sandbox_lib path:" "${CEF_SANDBOX_LIB_DEBUG}," "${CEF_SANDBOX_LIB_RELEASE}" )
138- # Logical target used to link the cef_sandbox library.
139- ADD_LOGICAL_TARGET ("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG} " "${CEF_SANDBOX_LIB_RELEASE} " )
140- endif ()
141-
142114PRINT_CEF_CONFIG ()
143115
144116# #################################################################################
@@ -189,3 +161,32 @@ if(${Need_Config_CefVersion_File})
189161else ()
190162 message (STATUS "No need to configure CefVersion.h file" )
191163endif ()
164+
165+ # config CEF sandbox
166+ if (USE_SANDBOX AND (OS_MACOS OR (OS_WINDOWS AND (CEF_VERSION_MAJOR LESS 138))))
167+ add_definitions (-DCEF_USE_SANDBOX )
168+ message (STATUS "cef_sandbox_lib path:" "${CEF_SANDBOX_LIB_DEBUG} ," "${CEF_SANDBOX_LIB_RELEASE} " )
169+
170+ # Logical target used to link the cef_sandbox library.
171+ ADD_LOGICAL_TARGET ("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG} " "${CEF_SANDBOX_LIB_RELEASE} " )
172+ endif ()
173+
174+ if (OS_WINDOWS)
175+ add_link_options (/DEBUG )
176+
177+ if (USE_SANDBOX AND (CEF_VERSION_MAJOR LESS 138))
178+ # cef_sandbox.lib is MT already, must keep the same with it
179+ set (CEF_RUNTIME_LIBRARY_FLAG "/MT" CACHE STRING "Use static runtime" )
180+ add_compile_options ("/MT$<$<CONFIG :Debug >:d >" )
181+ else ()
182+ # either MT or MD is supported
183+ set (CEF_RUNTIME_LIBRARY_FLAG "/M$<IF :$<BOOL :${STATIC_CRT} >,T ,D >" CACHE STRING "Use static runtime" FORCE )
184+ add_compile_options ("/M$<IF :$<BOOL :${STATIC_CRT} >,T ,D >$<$<CONFIG :Debug >:d >" )
185+ endif ()
186+ else ()
187+ add_compile_options (
188+ "-g"
189+ "$<$<CONFIG :DEBUG >:-O0 >"
190+ "$<$<CONFIG :RELEASE >:-O3 >"
191+ )
192+ endif ()
0 commit comments