summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-Embarcadero.cmake
Commit message (Collapse)AuthorAgeFilesLines
* PCH: Mark CMake PCH source files as -x <lang>-headerCristian Adam2020-09-041-1/+6
| | | | Fixes: #21163
* PCH: Clang: Update PCH usage flags to include original headerSergey Larin2020-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | Add an additional include flag to PCH usage command line to fix programs that rely on `compile_commands.json` file. Pass it to the preprocessor directly to avoid compiler driver to change it to '-include-pch'. When preprocessor is requested to preprocess a file, it tries to get the original filename from '.pch' and uses that file for preprocessing. CMake generates a '.pch' file from the '.hxx' file by passing an empty '.cxx' source file to the compiler as a compilation unit and the header file with the '-include' flag. After that, compiler puts compilation unit filename in the '.pch' as the original filename. However, CMake build system uses empty file as the source file and passes the header file using '-include-pch' flag. As a result, Clang uses the wrong file for preprocessing and produces the corrupted preprocessed file. Fixes: #20355 Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
* Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-0/+7
| | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* LINK_OPTIONS: Add support of "LINKER:" prefixMarc Chevrier2018-06-061-0/+2
|
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-141-3/+3
| | | | | | | | | | | | | | Document these variables. Change our convention for setting these variables from: set(CMAKE_EXE_LINKER_FLAGS_INIT "...") to string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ...") so that any value previously set by a toolchain file will be used.
* Embarcadero: Set all CMAKE_*_LINKER_FLAGS_INIT directlyBrad King2016-07-131-9/+5
| | | | Avoid copying CMAKE_EXE_LINKER_FLAGS_INIT to the others.
* Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | Document these variables. Change our convention for setting these variables from: set(CMAKE_C_FLAGS_INIT "...") to string(APPEND CMAKE_C_FLAGS_INIT " ...") so that any value previously set by a toolchain file will be used. Automate the conversion with: sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \ Modules/Compiler/*.cmake Modules/Platform/*.cmake and follow up with some manual fixes (e.g. to cases that already meant to append). Also revert the automated changes to contexts that are not protected from running multiple times.
* Embarcadero: Fix bug where duplicate Ninja job pools would be created.James Johnston2015-12-031-1/+5
| | | | | If the platform file was included multiple times, it was possible that duplicate Ninja job pools would be created.
* Factor an <INCLUDES> placeholder out of <FLAGS> in rule variablesBrad King2015-07-131-2/+2
| | | | | | | | | | | Teach the Makefile and Ninja generators to substitute for an <INCLUDES> placeholder instead of putting -I in <FLAGS>. Update our values for CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE to place <INCLUDES> just before <FLAGS>.
* Place <DEFINES> before <FLAGS> consistently across compilersBrad King2015-07-131-2/+2
| | | | | | | | | | | | Update our values for CMAKE_<LANG>_COMPILE_OBJECT, CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE to place <DEFINES> before <FLAGS> consistently across supported compilers. We already do this for most compilers, so update the rest for consistency.
* Embarcadero: Run at most one linker invocation at a time (#15620)James Johnston2015-06-181-0/+6
| | | | | | | | | | | | | | | | | | | At least some versions (e.g. C++ Builder 5) of the bcc32 linker are known to write temporary files with a constant name to the current directory (e.g. "turboc.$ln"). (This can be verified by using Process Monitor to watch the file writes that bcc32 / ilink32 / implib make). This causes problems with some generators that keep a constant current directory and run concurrent linkers. For example, the Ninja generator, by default, always has the current directory set to the top of the build tree - resulting in conflicts between the linkers that are simultaneously trying to write to "turboc.$ln". Symptoms include direct errors regarding the "turboc.$ln" file, or later build steps failing due to corrupted output from previous links that happened to link "successfully." This is not a problem for the Borland Makefiles generator which does not run jobs in parallel. For the Ninja generator, work around this problem by using a link job pool of size 1.
* Embarcadero: Use response files only for includes, objects, and libsBrad King2013-06-271-3/+4
| | | | | | Leave other flags directly in the Makefile command lines and outside any special inline response file syntax. Otherwise Borland does not support flags with quotes in response files.
* Embarcadero: Fix default link stack/heap flags (#13912)Brad King2013-02-131-1/+1
| | | | | | | | | | | | | | | | Since commit c70beb4b (change the default borland stack size, 2003-05-05), commit 1b572eb9 (remove -H flags, 2003-05-08), and commit 2d411398 (Stack size in generated programs should be 10 meg, 2003-06-12) CMake adds link flags to select a 10MB stack. At the time this was for consistency with our behavior on MS, but that was recently removed by commit 51af1da3 (Remove "/STACK:10000000" from default linker flags, 2012-11-23). Change our Embarcadero link flags to select the default stack and heap settings according to the compiler documentation. This is more reliable than leaving the flags out completely as it has been reported that the linker does not always use its documented defaults. Suggested-by: Mathäus Mendel <contato@mathausmendel.com>
* Convert CMake-language commands to lower caseKitware Robot2012-08-131-20/+20
| | | | | | | | | | | | | | | | | Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Add platform variable for flags specific to shared librariesStephen Kelly2012-06-121-1/+2
| | | | | | Store in CMAKE_${lang}_COMPILE_OPTIONS_DLL flags from CMAKE_SHARED_LIBRARY_${lang}_FLAGS that are truly exclusive to shared libraries.
* Recognize Embarcadero compiler (#12604)Brad King2012-02-201-22/+30
| | | | | | | | | | | | | | | | | | | The Borland compiler was re-branded as CodeGear during 2007-2009 and since 2009 is the Embarcadero compiler. They offer predefined macros: http://docwiki.embarcadero.com/RADStudio/en/Predefined_Macros and distinguish themselves by __CODEGEARC__ and __CODEGEARC_VERSION__. Version 6.30 (C++Builder XE) changed the meaning of some flags: http://docwiki.embarcadero.com/RADStudio/en/C%2B%2B_Compiler_Option_Changes_for_XE Teach Embarcadero compiler information files to generate build rules with flags matching the compiler version. Leave the flags unchanged for old Borland versions. Always set the BORLAND toolchain indicator for compatibility with existing projects that test it. Also set the EMBARCADERO indicator for newer toolchains.
* Rename Modules/Platform/Windows-{Borland => Embarcadero}.cmakeBrad King2012-02-171-0/+121
The Borland compiler is now the Embarcadero compiler. Rename the shared platform information file to reflect this. This does not change the interface, as old versions are still "Borland", but will allow new versions released by Embarcadero to be supported cleanly.