Explorar el Código

cotire 1.1.4

master
Sascha Kratky hace 13 años
padre
commit
95e10831a4
Se han modificado 3 ficheros con 22 adiciones y 8 borrados
  1. +16
    -8
      CMake/cotire.cmake
  2. +5
    -0
      HISTORY.md
  3. +1
    -0
      README.md

+ 16
- 8
CMake/cotire.cmake Ver fichero

@@ -44,7 +44,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE)
endif() endif()


set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}") set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
set (COTIRE_CMAKE_MODULE_VERSION "1.1.3")
set (COTIRE_CMAKE_MODULE_VERSION "1.1.4")


include(CMakeParseArguments) include(CMakeParseArguments)


@@ -1680,15 +1680,23 @@ function (cotire_setup_unity_generation_commands _language _target _targetScript
foreach (_unityFile ${_unityFiles}) foreach (_unityFile ${_unityFiles})
file (RELATIVE_PATH _unityFileRelPath "${CMAKE_BINARY_DIR}" "${_unityFile}") file (RELATIVE_PATH _unityFileRelPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
set_property (SOURCE "${_unityFile}" PROPERTY GENERATED TRUE) set_property (SOURCE "${_unityFile}" PROPERTY GENERATED TRUE)
# set up compiled unity source dependencies
# this ensures that missing source files are generated before the unity file is compiled
if (COTIRE_DEBUG)
message (STATUS "${_unityCmd} OBJECT_DEPENDS ${_dependencySources}")
endif()
if (_dependencySources)
set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_dependencySources})
endif()
cotire_set_cmd_to_prologue(_unityCmd) cotire_set_cmd_to_prologue(_unityCmd)
list (APPEND _unityCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "unity" "${_targetScript}" "${_unityFile}") list (APPEND _unityCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "unity" "${_targetScript}" "${_unityFile}")
if (COTIRE_DEBUG) if (COTIRE_DEBUG)
message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_targetScript} ${_dependencySources}")
message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_targetScript}")
endif() endif()
add_custom_command( add_custom_command(
OUTPUT "${_unityFile}" OUTPUT "${_unityFile}"
COMMAND ${_unityCmd} COMMAND ${_unityCmd}
DEPENDS "${_targetScript}" ${_dependencySources}
DEPENDS "${_targetScript}"
COMMENT "Generating ${_language} unity source ${_unityFileRelPath}" COMMENT "Generating ${_language} unity source ${_unityFileRelPath}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM)
list (APPEND ${_cmdsVar} COMMAND ${_unityCmd}) list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
@@ -2331,15 +2339,15 @@ if (CMAKE_SCRIPT_MODE_FILE)
endif() endif()
endforeach() endforeach()


if (COTIRE_DEBUG)
message (STATUS "${COTIRE_ARGV0} ${COTIRE_ARGV1} ${COTIRE_ARGV2} ${COTIRE_ARGV3} ${COTIRE_ARGV4} ${COTIRE_ARGV5}")
endif()

# include target script if available # include target script if available
if ("${COTIRE_ARGV2}" MATCHES "\\.cmake$") if ("${COTIRE_ARGV2}" MATCHES "\\.cmake$")
include("${COTIRE_ARGV2}") include("${COTIRE_ARGV2}")
endif() endif()


if (COTIRE_DEBUG)
message (STATUS "${COTIRE_ARGV0} ${COTIRE_ARGV1} ${COTIRE_ARGV2} ${COTIRE_ARGV3} ${COTIRE_ARGV4} ${COTIRE_ARGV5}")
endif()

if (WIN32) if (WIN32)
# for MSVC, compiler IDs may not always be set correctly # for MSVC, compiler IDs may not always be set correctly
if (MSVC) if (MSVC)
@@ -2378,7 +2386,7 @@ if (CMAKE_SCRIPT_MODE_FILE)
cotire_generate_unity_source( cotire_generate_unity_source(
"${COTIRE_ARGV3}" ${_sources} "${COTIRE_ARGV3}" ${_sources}
LANGUAGE "${COTIRE_TARGET_LANGUAGE}" LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
DEPENDS "${COTIRE_ARGV0}" "${COTIRE_ARGV2}" ${COTIRE_TARGET_UNITY_DEPENDS}
DEPENDS "${COTIRE_ARGV0}" "${COTIRE_ARGV2}"
SOURCES_COMPILE_DEFINITIONS ${_sourcesDefinitions} SOURCES_COMPILE_DEFINITIONS ${_sourcesDefinitions}
PRE_UNDEFS ${_targetPreUndefs} PRE_UNDEFS ${_targetPreUndefs}
POST_UNDEFS ${_targetPostUndefs} POST_UNDEFS ${_targetPostUndefs}


+ 5
- 0
HISTORY.md Ver fichero

@@ -1,3 +1,8 @@
## 1.1.4 (2012-08-15)

* prevent redundant re-generation of the unity source, prefix header and precompiled header files
(this makes cotire more applicable to C++ projects that use Qt).

## 1.1.3 (2012-08-12) ## 1.1.3 (2012-08-12)


* fix out of range index operation upon building list of target include directories. * fix out of range index operation upon building list of target include directories.


+ 1
- 0
README.md Ver fichero

@@ -21,6 +21,7 @@ features
* Leverages native precompiled header generation features of IDEs (Visual Studio and Xcode). * Leverages native precompiled header generation features of IDEs (Visual Studio and Xcode).
* Compatible with CMake's [cross-compiling][ccrc] support. * Compatible with CMake's [cross-compiling][ccrc] support.
* Compatible with compiler wrappers like [ccache][ccch]. * Compatible with compiler wrappers like [ccache][ccch].
* Applicable to CMake based Qt projects.
* Tested with Windows, Linux and OS X. * Tested with Windows, Linux and OS X.
* MIT licensed. * MIT licensed.




Cargando…
Cancelar
Guardar