|
@@ -398,7 +398,6 @@ if (URHO3D_CLANG_TOOLS OR URHO3D_BINDINGS)
|
|
|
endif ()
|
|
endif ()
|
|
|
endif ()
|
|
endif ()
|
|
|
if (URHO3D_CLANG_TOOLS)
|
|
if (URHO3D_CLANG_TOOLS)
|
|
|
- # Require C++11 standard and no precompiled-header
|
|
|
|
|
set (URHO3D_PCH 0)
|
|
set (URHO3D_PCH 0)
|
|
|
set (URHO3D_LIB_TYPE SHARED)
|
|
set (URHO3D_LIB_TYPE SHARED)
|
|
|
# Set build options that would maximise the AST of Urho3D library
|
|
# Set build options that would maximise the AST of Urho3D library
|
|
@@ -1254,7 +1253,7 @@ macro (enable_pch HEADER_PATHNAME)
|
|
|
foreach (CONFIG ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) # These two vars are mutually exclusive
|
|
foreach (CONFIG ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) # These two vars are mutually exclusive
|
|
|
# Generate *.rsp containing configuration specific compiler flags
|
|
# Generate *.rsp containing configuration specific compiler flags
|
|
|
string (TOUPPER ${CONFIG} UPPERCASE_CONFIG)
|
|
string (TOUPPER ${CONFIG} UPPERCASE_CONFIG)
|
|
|
- file (WRITE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new "${COMPILE_DEFINITIONS} ${SYSROOT_FLAGS} ${CLANG_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS_${UPPERCASE_CONFIG}} ${COMPILER_HIDDEN_VISIBILITY_FLAGS} ${COMPILER_HIDDEN_INLINE_VISIBILITY_FLAGS} ${PIC_FLAGS} ${INCLUDE_DIRECTORIES} -c -x ${LANG_H}")
|
|
|
|
|
|
|
+ file (WRITE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new "${COMPILE_DEFINITIONS} ${SYSROOT_FLAGS} ${CLANG_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS} ${CMAKE_${LANG}_FLAGS_${UPPERCASE_CONFIG}} ${COMPILER_HIDDEN_VISIBILITY_FLAGS} ${COMPILER_HIDDEN_INLINE_VISIBILITY_FLAGS} ${PIC_FLAGS} -std=c++11 ${INCLUDE_DIRECTORIES} -c -x ${LANG_H}")
|
|
|
execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new ${ABS_PATH_PCH}.${CONFIG}.pch.rsp)
|
|
execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new ${ABS_PATH_PCH}.${CONFIG}.pch.rsp)
|
|
|
file (REMOVE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new)
|
|
file (REMOVE ${ABS_PATH_PCH}.${CONFIG}.pch.rsp.new)
|
|
|
if (NOT ${TARGET_NAME}_PCH_DEPS)
|
|
if (NOT ${TARGET_NAME}_PCH_DEPS)
|
|
@@ -1281,7 +1280,7 @@ macro (enable_pch HEADER_PATHNAME)
|
|
|
add_make_clean_files (${PCH_FILENAME}/${PCH_FILENAME}.${CONFIG})
|
|
add_make_clean_files (${PCH_FILENAME}/${PCH_FILENAME}.${CONFIG})
|
|
|
endforeach ()
|
|
endforeach ()
|
|
|
# Using precompiled header file
|
|
# Using precompiled header file
|
|
|
- set (CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS} -include \"${ABS_PATH_PCH}\"")
|
|
|
|
|
|
|
+ set (CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS} -include \"${ABS_PATH_PCH}\" -Winvalid-pch") # Catch the invalid PCH sooner
|
|
|
unset (${TARGET_NAME}_HEADER_PATHNAME)
|
|
unset (${TARGET_NAME}_HEADER_PATHNAME)
|
|
|
else ()
|
|
else ()
|
|
|
# The target has not been created yet, so set an internal variable to come back here again later
|
|
# The target has not been created yet, so set an internal variable to come back here again later
|