Commit graph

153 commits

Author SHA1 Message Date
Jérôme Gardou 9c4ae0d05e [CMAKE] Honor CMAKE_EXE_LINKER_FLAGS_INIT in GCC build 2021-04-06 19:26:33 +02:00
Jérôme Gardou f5bace8536 [CMAKE] Move toolchain specific handling to set_module_type_toolchain
+ style fixes
2021-03-23 11:18:43 +01:00
Jérôme Gardou 5c21460680 [CMAKE] Put .rsrc section after the INIT section on drivers, like link.exe does 2021-03-23 11:18:43 +01:00
Jérôme Gardou e55123a6a2 [CMAKE] Add the kernel module type
Take this as an occasion to use target_link_options more
2021-03-23 11:18:43 +01:00
Jérôme Gardou 812c9e5a11 [CMAKE] Fixup of driver sections in GCC builds
Also introduce a helper variable to list KMode modules
2021-03-23 11:18:43 +01:00
Jérôme Gardou 5489efcb1a [SDK:TOOLS] Add --driver option to pefixup
For now, this adds IMAGE_SCN_MEM_DISCARDABLE to the INIT section, and IMAGE_SCN_MEM_NOT_PAGED to sections which are not named PAGE or .reloc
2021-03-23 11:18:43 +01:00
Jérôme Gardou 56b1baa3dd [CMAKE] Restore using LD linker script with GCC 2021-03-23 11:18:43 +01:00
Jérôme Gardou 6445f33704 [CMAKE] Put INIT section before .reloc and not after.
CORE-14683
2021-03-23 11:18:43 +01:00
Jérôme Gardou 49286a6225 [CMAKE] Get rid of add_object_library
It's not needed anymore
2021-03-03 08:34:32 +01:00
Jérôme Gardou c68739e566 [CMAKE] Preprocess the ASM files but let msbuild handle their actual compilation
CORE-17423
2021-03-03 08:34:32 +01:00
Jérôme Gardou 41130ab5c6 [CMAKE] Use ASM_MASM language when building with MSVC toolchain
CORE-17423
2021-03-03 08:34:32 +01:00
Mark Jansen 35103558e1
[CMAKE] Fix empty dependencies.graphml being created 2021-02-07 14:02:01 +01:00
Hervé Poussineau ebb7088b02 [CMAKE] Remove unused variables _ELF_
This is not used anymore since r55855 (818418643e)
2021-02-04 11:14:59 +01:00
Victor Perevertkin 5375e33490
[CMAKE] Generate Flex and Bison files at build time
We have Flex and Bison distributed along with RosBE 2.2 so this should
not be a problem
2021-01-28 06:43:05 +03:00
Mark Jansen b1bf3aae50
[CMAKE] Fix host-tools path for MSVC IDE 2021-01-08 21:12:11 +01:00
Hervé Poussineau 39545c3385 [CMAKE] Use -Wno-error when compiling with GCC x64 2021-01-05 14:19:45 +01:00
Jérôme Gardou c8d07514c8 [CMAKE] Fix GCC -fstack-protector usage 2021-01-05 13:38:57 +01:00
Victor Perevertkin edb425d89e
[CMAKE] Use consolidated registry.inf for generating SETUPREG.HIV
This way all registry data generated by add_registry_inf goes there.
SETUPREG.HIV increased by about 12KiB after that
2021-01-04 16:50:32 +03:00
Victor Perevertkin e394a1312a
[CMAKE] Replace CMAKE_AR with CMAKE_LINKER /LIB for msvc
Render the command to a variable for dealing with quotes properly

Addendum to ca1b2ada34 and b96e88894a
2021-01-03 04:06:51 +03:00
Victor Perevertkin ca1b2ada34
[CMAKE] Replace DIVISION_SLASH unicode character with SOLIDUS
This fixes the build on some machines. In addition, replace
the hardcoded "LINK /LIB" with ${CMAKE_AR}

Addendum to b96e88894a
2021-01-03 03:46:12 +03:00
Jérôme Gardou b96e88894a [CMAKE] Turn import libs into regular C static libs
Embed msvcrtex into libmsvcrt

Idea taken from Thomas Faber
2020-12-28 12:13:30 +01:00
Jérôme Gardou 56e56f8ecc [CMAKE] Use -fcommon when using CLang 2020-12-28 12:13:30 +01:00
Victor Perevertkin 6bab72f69a
[CMAKE] Fix RUNTIME_CHECKS dependent option
Addendum to 92dfec219d and a2a6038e56
2020-12-14 21:09:14 +03:00
Victor Perevertkin 16e5ce8fb1
[CMAKE] Use C_STANDARD property instead of command line option
Addendum to 64211aa696 and 19779b3f96
2020-12-05 15:35:06 +03:00
Hervé Poussineau 4469ab3620 [CMAKE] Disable compression of debug sections in GCC <= 7.0
We use MSVC, Clang or GCC > 7.0 these days.
2020-12-01 18:44:53 +01:00
Jérôme Gardou f54c7b646c [VMAKE/WIDL] Properly fix build (try 3) 2020-11-20 19:57:48 +01:00
Jérôme Gardou 72d9471424 [CMAKE] Fix host tools dependency tracking 2020-11-20 19:57:48 +01:00
Jérôme Gardou 8297109b95 [CMAKE/WIDL] Fix build (try 2) 2020-11-20 10:17:43 +01:00
Jérôme Gardou acfff0919e [CMAKE/WIDL] Fix build 2020-11-20 10:12:31 +01:00
Jérôme Gardou b587e7b32e [CMAKE/WIDL] Run widl from the source directory
This dramatically improves ccache direct hit rate as now the generated files are identical across build trees
2020-11-20 09:47:33 +01:00
Jérôme Gardou edc1f3ca56 [CMAKE] Fix use of CLang
- Updated toolchain file
 - set GCC variable when using CLang in "GCC mode"
 - Properly retrieve GCC support libraries
 - Various flags needed to get this going
2020-11-16 16:58:10 +01:00
Jérôme Gardou bf04126e02 |CMAKE] Use RULE_LAUNCH_COMPILE property to handle ccache 2020-11-09 10:47:19 +01:00
Victor Perevertkin 658f742c2d
[NDK][CMAKE] Introduce DATA_SEG and CODE_SEG macro
These are for putting code and data to non-default sections
At the same time, move INIT section attributes declaration to cmake files
2020-11-02 21:27:06 +03:00
Timo Kreuzer d685dcee9b [CMAKE] Rename def files for import libraries on MSVC builds to *_implib.de like on GCC 2020-11-01 09:33:14 +01:00
Serge Gautherie a2a6038e56
[CMAKE] MSVC RUNTIME_CHECKS is a 'Debug'-only feature
"cl : Command line error D8016 : '/Ox' and '/RTC1' command-line options are incompatible"

Addendum to 92dfec219d.
2020-10-24 04:28:16 +03:00
Jérôme Gardou 23e04ae1ee [CMAKE] Use an INTERFACE library to perform the msvcrt <-> msvcrtex binding 2020-10-22 18:07:27 +02:00
Jérôme Gardou 5c25e816bf [CMAKE] Only link msvcrtex to win32cui, win32gui, win32dll, win32ocx and cpl modules 2020-10-22 18:07:27 +02:00
Jérôme Gardou 840fe4d6ac [CMAKE] Introduce the REACTOS_MODULE_TYPE target property
And set it in set_module_type function
2020-10-22 18:07:27 +02:00
Jérôme Gardou bbe47e61b1 |CMAKE] Use ExternalProject for host-tools build 2020-10-22 09:31:11 +02:00
Jérôme Gardou 00ed72d7e8 [CMAKE] Get rid of add_compile_flags
Use add_compile_options and the like instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou 84621b3634 [CMAKE] Get rid of replace_compiler_option macro
This is not used anymore
2020-10-20 21:44:54 +02:00
Jérôme Gardou 683489ccf1 [CMAKE] Use -ffile-prefix-map for GCC builds
And also simplify the __RELFILE__ macro definition for the other cases
2020-10-20 21:44:54 +02:00
Jérôme Gardou ed61512236 [CMAKE] Get rid of add_compile_flags_language macro
in favor of add_compile_options and the like with generator expressions
Also take this as an opportunity to remove the C++11 standard hack, GCC 8 now defaults to C++14
2020-10-20 21:44:54 +02:00
Jérôme Gardou 7e116f0ef3 [CMAKE] Get rid of replace_compile_flags
Introduce a finer-grained remove_target_compile_option instead
2020-10-20 21:44:54 +02:00
Jérôme Gardou b52fa999eb [CMAKE] Get rid of replace_compile_flags_language macro
It was only used in the set_cpp macro
2020-10-20 21:44:54 +02:00
Jérôme Gardou 8b28f8d9ba [CMAKE] Allow INTERFACE libraries for MSVC IDEs 2020-10-20 21:44:54 +02:00
Jérôme Gardou d6ea8659c8 [CMAKE] Get rid of the set_cpp macro
Instead of messing with global variables and the like, we introduce two target properties:
 - WITH_CXX_EXCEPTIONS: if you want to use C++ exceptions
 - WITH_CXX_RTTI: if you need RTTI in your module
You can use the newly introduced set_target_cpp_properties function, with WITH_EXCEPTIONS and WITH_RTTI arguments
We also introduce two libraries :
 - cpprt: for C++ runtime routines
 - cppstl: for the C++ standard template library

NB: On GCC, this requires to create imported libraries with the related built-in libraries:libsupc++, limingwex, libstdc++

Finally, we manage the relevant flags with the ad-hoc generator expressions

So, if you don't need exceptions, nor RTTI, nor use any runtime at all: you simply have nothing else to do than add your C++ file to your module
2020-10-20 21:44:54 +02:00
Jérôme Gardou d0ed4fdb3a [CMAKE] Fix generation of UTF-16 inf file 2020-10-20 15:21:00 +02:00
Timo Kreuzer 280aa21179 [CMAKE] Add baseaddress_msvc_x64.cmake 2020-09-20 23:08:17 +02:00
Mark Jansen 5730485a51 [SDK] Add dummy import lib files for MSVC_IDE build,
to work around a CMake bug generating broken dll targets
ROSBE-159
2020-09-20 19:18:15 +02:00