Sfoglia il codice sorgente

cotire 1.1.6

master
Sascha Kratky 13 anni fa
parent
commit
1b680fe697
3 ha cambiato i file con 40 aggiunte e 3 eliminazioni
  1. +9
    -2
      CMake/cotire.cmake
  2. +6
    -0
      HISTORY.md
  3. +25
    -1
      MANUAL.md

+ 9
- 2
CMake/cotire.cmake Vedi File

@@ -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.5")
set (COTIRE_CMAKE_MODULE_VERSION "1.1.6")


include(CMakeParseArguments) include(CMakeParseArguments)


@@ -943,7 +943,11 @@ function (cotire_scan_includes _includesVar)
# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared # cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
unset (ENV{VS_UNICODE_OUTPUT}) unset (ENV{VS_UNICODE_OUTPUT})
endif() endif()
execute_process(COMMAND ${_cmd} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_QUIET ERROR_VARIABLE _output)
execute_process(COMMAND ${_cmd} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
RESULT_VARIABLE _result OUTPUT_QUIET ERROR_VARIABLE _output)
if (_result)
message (STATUS "Result ${_result} scanning includes of ${_existingSourceFiles}.")
endif()
cotire_parse_includes( cotire_parse_includes(
"${_option_LANGUAGE}" "${_output}" "${_option_LANGUAGE}" "${_output}"
"${_option_IGNORE_PATH}" "${_option_INCLUDE_PATH}" "${_option_IGNORE_PATH}" "${_option_INCLUDE_PATH}"
@@ -2030,6 +2034,9 @@ function (cotire_setup_pch_target _languages _configurations _target)
cotire_init_target("${_pchTargetName}") cotire_init_target("${_pchTargetName}")
cotire_add_to_pch_all_target(${_pchTargetName}) cotire_add_to_pch_all_target(${_pchTargetName})
endif() endif()
else()
# for other generators, we add the "clean all" target to clean up the precompiled header
cotire_setup_clean_all_target()
endif() endif()
endfunction() endfunction()




+ 6
- 0
HISTORY.md Vedi File

@@ -1,3 +1,9 @@
## 1.1.6 (2012-09-22)

* check result code upon scanning includes.
* always add a `clean_cotire` target to easily clean up cotire generated files.
* add section on `extern "C"` linkage issues to manual.

## 1.1.5 (2012-08-17) ## 1.1.5 (2012-08-17)


* new cache variable `COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS` can be set to globally exclude * new cache variable `COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS` can be set to globally exclude


+ 25
- 1
MANUAL.md Vedi File

@@ -296,7 +296,7 @@ ignore other project related headers in `CMAKE_SOURCE_DIR`:
The properties `COTIRE_PREFIX_HEADER_IGNORE_PATH` and `COTIRE_PREFIX_HEADER_INCLUDE_PATH` can The properties `COTIRE_PREFIX_HEADER_IGNORE_PATH` and `COTIRE_PREFIX_HEADER_INCLUDE_PATH` can
also be set on directories. also be set on directories.


The following cache variables also affect the selection of prefix headers.
The following cache variables also affect the selection of prefix headers:


* Directory paths in `COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH` will be added to the list of * Directory paths in `COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH` will be added to the list of
ignored directories when the prefix header file is created. ignored directories when the prefix header file is created.
@@ -312,6 +312,30 @@ precompiled header and would result in a rebuild of the whole target. To make th
creation dependent on changes to certain target source files, the source file property creation dependent on changes to certain target source files, the source file property
`COTIRE_DEPENDENCY` can be set to `TRUE` for those files. `COTIRE_DEPENDENCY` can be set to `TRUE` for those files.


### fixing linkage issues

When a C++ program uses `extern "C"` on a system header file, cotire will not be able to detect
that the include file needs C linkage and will include the file with C++ linkage in the generated
prefix header instead. For example, the C interface to BLAS `cblas.h` usually has to be included
as `extern "C"` in a C++ program:

extern "C" {
#include <cblas.h>
}

The presence of `extern "C"` includes will prevent cotired targets from being linked successfully
because of unresolved function references using the wrong linkage. To work around the problem,
the property `COTIRE_PREFIX_HEADER_IGNORE_PATH` can be set to a list including the full path of
the `extern "C"` header file. Here's an example:

set_property(DIRECTORY
PROPERTY COTIRE_PREFIX_HEADER_IGNORE_PATH
"${ATLAS_INCLUDE_DIR}/cblas.h"
"${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}")

That way `cblas.h` will not be included in the generated prefix header and will not cause problems
upon linking.

### configuring the generation of the unity source ### configuring the generation of the unity source


By default cotire adds all target source file to the generated unity source. In most cases a By default cotire adds all target source file to the generated unity source. In most cases a


Caricamento…
Annulla
Salva