Commit graph

192 commits

Author SHA1 Message Date
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
Joachim Henze a4fee60e46 [CMAKE] Fix regressions CORE-17243 & CORE-17246
By sledge-hammer-reverting of
0.4.15-dev-689-g
7ffb6a09c3

and 0.4.15-dev-688-g
1234223f41

Sorry, but the negative impact for other devs and the
whole project are just unbearable.
Stuff got committed meanwhile even so I had to act.
The improvements may be reapplied later when the
negative consequences are under control.
2020-09-06 04:35:33 +02:00
Jérôme Gardou 7ffb6a09c3 [CMAKE] Overhaul creation from CD
Get rid of global properties and use a target-level properties instead
Limit temporary files by using cmake-generator expressions instead
Avoid function calls at the end configuration, use file(GENERATE) idiom instead
2020-09-02 11:02:44 +02:00
Thomas Faber a81788e5bf
[CMAKE] Explicitly target Pentium for clang. CORE-17202
The MSVC-compatible /arch:IA32 option switches to i386 mode, which
makes clang avoid 486/Pentium-specific instructions, e.g. cmpxchg8b.
2020-08-23 12:07:37 +02:00
Thomas Faber 8275c1f991
[CMAKE] Use a space after /fo for the RC compiler to make clang happy. CORE-17202 2020-08-23 12:07:37 +02:00
Dmitry Borisov 27cd9eaf1a
[PC98VID] Add framebuffer video miniport driver for NEC PC-98 series (#3040)
This adds generic graphics support on PC-9821.
2020-08-19 00:50:08 +03:00
Mark Jansen 7dc306c440
[SDK] Fix host-tools build from visual studio ide in Release 2020-07-09 21:32:53 +02:00
Serge Gautherie aae5cd8ea2
[CMAKE] Remove obsolete 'GCC_VERSION' checks (#2962)
following upgrade to RosBE 2.2.0 support and GCC 8.4.
2020-07-04 15:33:50 +02:00
Thomas Faber dd6eb40381
[CMAKE] Remove work-arounds for old CMake versions. CORE-17109 2020-06-20 15:25:29 +02:00
Thomas Faber add677e45b
[CMAKE] Bump minimum to 3.17, no longer require -ReactOS build. CORE-17109 2020-06-20 15:25:28 +02:00
Thomas Faber 3169c94e06
[CMAKE] Set CMAKE_MSVC_RUNTIME_LIBRARY to satisfy CMP0091. CORE-17109
We use /NODEFAULTLIB, and consequently also don't want CMake to add
a default library for us.
2020-06-20 15:25:27 +02:00
Thomas Faber dadc59f135
[CMAKE] Mark host tools as byproducts. CORE-17109 2020-06-20 15:25:27 +02:00
Amine Khaldi 139a3d6661
[CMAKE] Implement PCH builds with target_precompile_headers. CORE-16905 2020-06-06 21:58:41 +03:00
Serge Gautherie 11345aedd8
[FORMATTING] [CMAKE] Remove space in 'if (' (#2847) 2020-05-26 20:24:02 +02:00
Joachim Henze d28677795e [NTOSKRNL] Restore section layout for NTOSKRNL to fix BSOD regression CORE-14683
This version (after .rsrc) works different than the
proper version I used for 0.4.12 (after .reloc).

Inserting after .rsrc is actually not correct, but Thomas believes it can
be used as a temporary trick to avoid random memory corruption upon
relocations of the kernel, caused by ROSBE-154.

I follow his advice, although when judging from practical tests only:
as long as we limit this script to NTOSKRNL like I do for releases
there have no negative consequences been observed in real life yet
even with the proper version of 0.4.12.
Up to now those problems have only been observed when used for drivers
MODULE TYPE sdk/cmake/gcc.cmake as well, like
it was tried for a moment in master 0.4.13-dev-609-g
c4d8e2a6e9

Using for drivers immediately did lead to BSODs like CORE-16183 and therefore was
mitigated in master by total disabling of the scripts for both,
kernel and drivers in
0.4.13-dev-621-g
36e9a6f8dd

To allow installing DVDWritenow without BSOD,
we need the script at least for ntoskrnl!

I committed this patch (after .rsrc) already into 0.4.13RC and 0.4.14RC.
2020-05-13 17:09:15 +02:00
Victor Perevertkin 156b3bd014
[REACTOS] Drop support for Visual Studio below 2015 2020-05-04 21:47:37 +03:00
Victor Perevertkin 95483b42ea
[REACTOS] Raise C standard to gnu99
And remove -Wdeclaration-after-statement
2020-05-04 21:44:55 +03:00
Victor Perevertkin f4e37f9363
[CMAKE] Support file lists in add_cd_file for all cases
Addendum to 6b48d54
2020-05-01 02:39:59 +03:00
Victor Perevertkin 6b48d54c39
[CMAKE] Fix driver inf files generation for livecd
CORE-16975
2020-05-01 01:23:51 +03:00
Victor Perevertkin 019f21ee1d
[MEDIA][CMAKE] Create add_driver_inf cmake function
*.inf files for drivers can now be placed along with the driver code
2020-04-26 20:28:04 +03:00
Sylvain Deverre 7f6246e660 [CMAKE] Fix SEPARATE_DBG build on GCC 2020-04-19 13:00:18 +02:00
Mark Jansen 0b948581fc
[SDK][HOST-TOOLS] Add load_config workaround for gcc builds
Since binutils can not add this, we re-introduce pefixup.
It searches for the exported symbol '_load_config_used',
and uses that to fill out the LOAD_CONFIG directory in the PE header
2020-04-17 17:47:24 +02:00
Victor Perevertkin 7e069ccdb2
[CMAKE] Replace custom functions to built-in ones
add_target_compile_definitions -> target_compile_definitions
add_target_compile_flags -> target_compile_options
add_target_include_directories -> target_include_directories
2020-04-16 15:59:38 +03:00
Victor Perevertkin 92dfec219d
[CMAKE][CONFIGURE] Enable runtime checks on MSVC by default.
Remove RTC switch from configure.cmd, now MSVC runtime checks are
supposed to be enabled/disabled via CMake define (-DRUNTIME_CHECKS=1)
Prepare for adding more dynamic analysis options
2020-04-11 02:48:12 +03:00
Victor Perevertkin 0d187f7d56
[CMAKE] Add --gc-sections flag to GCC linker.
This returns C++ binaries size to normal (on GCC 8.4).
I don't see any noticable effect of this on GCC 4.7.2

CORE-16670
2020-04-09 04:02:06 +03:00
Timo Kreuzer c735dbac35 [PRINTING] Add x64 print environment keys and folders 2020-03-09 07:03:47 +01:00
Serge Gautherie 29c1089983 [CMAKE] gcc.cmake: '-Wno-unused-const-variable' applies to GCC 6.1+
GCC 4.7.2 logs
'cc1: error: unrecognized command line option "-Wno-unused-const-variable" [-Werror]'

Addendum to 8eb7a1a2f4.
2020-03-08 13:30:10 +01:00
Hermès Bélusca-Maïto 93beefacbe
[CMAKE][FREELDR] Take the global defines into account when compiling ASM files.
Now the SARCH_xxx can be used in ASM files too.
Dedicated to Dmitry Borisov ;)
2020-03-06 22:55:12 +01:00
Thomas Faber 11ecf5c969
[CMAKE] Enable C4101 (unreferenced local variable) for MSVC builds.
This is already an error in GCC builds, so will make it harder for the
MSVC crowd to accidentally break GCC build.
2020-02-24 11:01:43 +01:00
Stanislav Motylkov 988f979139
[CMAKE][BOOTDATA] Properly load Xbox video miniport driver in LiveCD (#2325)
Surprisingly this also happens to "fix" random "Invalid Opcode" exceptions in XQEMU.
(But I think it's more like a coincidence... --hbelusca)

CORE-16627 CORE-16216
2020-02-10 23:20:12 +01:00
Dmitry Borisov 065afd93fd [FREELDR] Add FAT12 file system boot sector for NEC PC-98 series (#2025)
The first part of PC-98 Port - https://reactos.org/wiki/PC-98

- Add FAT12 file system boot sector for NEC PC-98 series.
- Add a new build target for a PC-98 bootable floppy disk.
- Add a new sub-architecture into config.cmake.
2020-01-18 19:16:23 +01:00
Mark Jansen 5b4dbec140
[CMAKE] Update baseaddresses with gcc 8.3 2019-12-27 19:52:21 +01:00
Mark Jansen 0bd9535d4d
[CMAKE] Update baseaddresses 2019-12-22 15:38:36 +01:00
Timo Kreuzer 0ff3bb904b [CMAKE] Turn printf format warnings (C4313 and C4477) into errors 2019-11-24 09:28:00 +01:00
Timo Kreuzer 70bcd0fc6b [CMAKE] Disable EH4 for x64 and VS versions 16.3+
This fixes x64 build with latest VS 2019
See https://developercommunity.visualstudio.com/content/problem/746534/visual-c-163-runtime-uses-an-unsupported-api-for-u.html
2019-11-24 09:26:59 +01:00
Timo Kreuzer 767d424b0a [CMAKE] Turn C4715: "'function': not all control paths return a value" into an error on MSVC builds 2019-08-23 14:47:39 +02:00
Victor Perevertkin e90b6bb1e9 [CMAKE] Define GCC and CLANG cmake variables 2019-08-20 15:05:47 +02:00
Andrew Cook 0341ea5e7b
Search for host-tools path
Allows source-relative paths
2019-08-17 17:39:44 +02:00
Andrew Cook f67345320f
Add WITH_HOST_TOOLS option
Required for cross-compiling with msvc as only one target
architecture is available at a time in the dev prompt
2019-08-17 17:39:43 +02:00
Andrew Cook ce531a28ec
Rework host tools
Now configured at the same time as reactos and only
one list of targets to maintain

Correctly rebuilds when a tool changes (tested widl)
2019-08-17 17:39:31 +02:00
Timo Kreuzer 5aab1831f7 [CMAKE] Update base addresses 2019-07-20 13:56:18 +02:00
Timo Kreuzer 4b79367647 [CMAKE] Define _GLIBCXX_HAVE_BROKEN_VSWPRINTF to fix build with GLIBCXX and our c++ headers 2019-07-20 13:56:18 +02:00
Timo Kreuzer 58b615f668 [CMAKE] Disable some overly sensitive warnings
-Wno-unused-const-variable
-Wno-unused-local-typedefs
-Wno-deprecated
2019-07-20 13:56:18 +02:00
Thomas Faber 36e9a6f8dd
[CMAKE] Disable INIT section ld scripts for now. CORE-16183 ROSBE-154 2019-07-07 16:06:43 +02:00
Thomas Faber c4d8e2a6e9
[CMAKE] Ensure the INIT section is placed at the end of a module. CORE-14683
For MSVC, marking the section as discardable will do this automatically.
For GCC, we use a linker script that places it after the .reloc section
(which should be the last "real" section, check ld --verbose output for the
default linker script).

This fixes what seems to be a regression from r55835 (!).
2019-07-07 08:18:10 +02:00
Timo Kreuzer 18e835b605 [SDK] Fix build with sal.h
* sal.h: add file header, uncomment _Interlocked_operand_ and PAL_STDCPP_COMPAT guard
* When including stl headers, define PAL_STDCPP_COMPAT
2019-06-29 12:13:09 +02:00
Hervé Poussineau 8eb7a1a2f4 [CMAKE] Disable unused-const-variable warning
This prevents some errors like this one:

In file included from ../dll/win32/wldap32/ber.c:27:0:
../sdk/include/reactos/wine/debug.h:378:48: error: '__wine_dbch___default' defined but not used [-Werror=unused-const-variable=]
     static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch
                                                ^
../dll/win32/wldap32/ber.c:29:1: note: in expansion of macro 'WINE_DEFAULT_DEBUG_CHANNEL'
 WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
 ^~~~~~~~~~~~~~~~~~~~~~~~~~
2019-05-27 13:22:40 +02:00
Hervé Poussineau 5fe74532af [CMAKE] Disable --compress-debug-sections on GCC >= 7.0
This leads to 'bad reloc address in section .zdebug_info'
2019-05-27 13:22:40 +02:00
Timo Kreuzer fad4b34db7 [CMAKE] Fix LINK_DEPENDS usage
Up to CMake 3.3 LINK_DEPENDS was ignored in non-Makefile generators. See also http://www.cmake.org/pipermail/cmake/2010-May/037206.html. Since CMake 3.4 it is no longer ignored, but requires CMP0005 policy to be set to NEW and it requires a full path which was already correctly used on GCC, but not on MSVC builds.
2019-04-27 14:29:33 +02:00
Andrew Cook 716613cddc [CMAKE] Use new policies for CMP0005 and CMP0018 (#1481)
* [CMAKE] Fix for CMP0018
The new behaviour lets us explicitly disabling position independent code, avoiding the need to change undocumented variables

* LINK_DEPENDS is semicolon separated

* [CMAKE] Fix for CMP0005
it seems impossible to have cmake correct escape PROXY_CLSID_IS so move it to the header
2019-04-27 11:33:37 +02:00
Serge Gautherie 9f3eb1f9a2 [CMAKE] msvc.cmake: Remove now redundant '/we4028' special case
Addendum to 545a2c7936.

CORE-7538
2019-04-19 20:47:03 +02:00
Timo Kreuzer 545a2c7936 [CMAKE] Add 3 more critical warnings for MSVC
- C4311: pointer truncation from '<pointer>' to '<integer>'
- C4312: conversion from '<integer>' to '<pointer>' of greater size
- C4133: incompatible types - from '<x> *' to '<y> *'
- C4028: formal parameter different from declaration
2019-04-13 14:07:50 +02:00
Foxlet 28804dd71d [THEMES] Mizu Theme RC. 2019-04-07 22:47:20 +02:00
Jérôme Gardou f489c3fd07 [CMAKE] Clear CMAKE_<LANGUAGE>_IMPLICIT_LINK_LIBRARIES and
_IMPLICIT_LINK_DIRECTORIES

Othrewise, if you link a RC module with a static C library (as done for
fusion DLLs), you get the standard C libraries from GCC. This is not
what we want.

This might have to be done for MSVC builds. Check build.ninja to verify
this.
2019-04-06 17:43:38 +02:00
Jérôme Gardou 979972b900 [CMAKE] unset EXPORT_SYMBOL for modules and shared libraries
We don't use that
2019-04-06 17:43:38 +02:00
Jérôme Gardou 23373acbb9 [CMAKE] Use modules instead of shared libraries
There is no need to compile our DLLs as shared libraries since we are
managing symbols exports and imports through spec files.

On my system, this reduces the configure-time by a factor of two.
2019-04-06 17:43:38 +02:00
Hervé Poussineau ef3ded6b97 [CMAKE] Enable -fno-aggressive-loop-optimizations only for GCC 4.8(+)
Previously, it was also enabled for GCC > 4.7, ie for example for GCC 4.7.1
2019-04-01 17:32:07 +02:00
Hervé Poussineau 95671c25ec [CMAKE] Add -fno-aggressive-loop-optimizations flag
ReactOS/Windows headers contain lots of structures whose last field is
fieldName[ANYSIZE] or fieldName[1].
Starting with GCC 4.8, gcc considers that accessing items [2], [3], ...
are undefined operation, and may optimize those accesses by removing them!

Add flag -fno-aggressive-loop-optimizations to prevent this unwanted behaviour.
2019-04-01 11:38:32 +02:00
Adam Słaboń 8946920109
[THEMES] Add new ReactOS theme - Lunar. By Adam Słaboń and Joann Mõndresku.
Reuse some Lautus assets, adjust the theme configuration and include it in the build process.
2019-03-31 22:13:15 +02:00
Serge Gautherie 237110604b [CMAKE] msvc.cmake: Remove 2 now redundant '/GF' (#1239)
Addendum to 5e673f3.
CORE-14373
2019-02-10 16:46:23 +01:00
Hermès Bélusca-Maïto 1b473cbeee
[SDK:CMAKE] Fix LINK command-line from the VS IDE for CMake VSSolution configurations, when using MSVC "linker script" files.
MSBuild, via the VS IDE, uses response files when calling CL or LINK.
We cannot specify a custom response file on the linker command-line,
since specifying response files from within response files is forbidden.
We therefore have to pre-process, at configuration time, the linker
script so as to retrieve the custom linker options to be appended
to the linker command-line.
2019-02-10 00:47:43 +01:00
Hermès Bélusca-Maïto 7d0cd6e937
[FREELDR][SDK:CMAKE] Move the `MSVC "linker script" file' functionality out of FreeLdr's cmake file and place it in the dedicated files instead. 2019-02-10 00:43:31 +01:00