Commit graph

65 commits

Author SHA1 Message Date
Victor Perevertkin
8ca4b0f257
[CMAKE] Remove __inline substitutions
All supported compilers can do C99 now, this is not needed anymore.
2021-10-26 22:51:03 +03:00
Justin Miller
be223b9de7
[SDK] Allow ARM64 MSVC to complete configuration (#4045)
- Add some of the missing CMake adjustments to continue the configure and compile process with ARM64 MSVC
- Created quick stubs for the functions in SDK needed to finish the configuration process
- Put in an ARM64 option for spec2def

CORE-17518 CORE-17615
2021-10-22 18:52:32 +03:00
Serge Gautherie
e4feaa1a69 [CMAKE] CMakeLists.txt: Add arm64 to ARCH allowed values
CORE-17518
2021-10-11 15:20:34 +03:00
Serge Gautherie
7e43c2610d [CMAKE] CMakeLists.txt: Fix 'omap-zoom2' typo
Addendum to fae2044 (r51783).
CORE-17604
2021-06-02 13:24:39 +03:00
Serge Gautherie
2dcc40fb3e [CMAKE] CMakeLists.txt: Remove NO_UNDERSCORE_PREFIX leftovers
And switch to add_compile_definitions().

Addendum to 9efafd6.
2021-06-02 10:04:21 +02:00
Mark Jansen
18e95f5a4e
[CMAKE] Store and re-use M4 and BISON_PKGDATADIR env variables
ROSBE-174
2021-05-22 16:38:17 +02:00
Serge Gautherie
b62f0d0fa3 [CMAKE] CMakeLists.txt: Print CMAKE_CONFIGURATION_TYPES
Follow-up to d10728a.
2021-05-06 16:13:05 +02:00
Jérôme Gardou
4ae4590b66 [CMAKE] Do not define _M_AMD64 when using amd64 clang-cl 2021-05-03 22:00:57 +02:00
Victor Perevertkin
d10728a645
[CMAKE] Rely less on CMAKE_BUILD_TYPE variable
Having conditional statements with CMAKE_BUILD_TYPE is an antipattern
See https://stackoverflow.com/questions/66079007/having-conditional-statements-on-build-type-variable-a-good-design

We use both single- and multi-config generators (Ninja and VS), so we
can't really rely on CMAKE_BUILD_TYPE, because it's not always set.

This commit alters some conditional flags to use <$CONFIG:...>
generator expression, but is still not complete. Also, our default
optimization level (4) now has what was always a de-facto flags
2021-04-15 06:44:56 +03:00
Victor Perevertkin
f0b53998c8
[CMAKE] Require ARCH variable to be specified explicitly
Also, use CMAKE_TRY_COMPILE_PLATFORM_VARIABLES in toolchain files
to solve issues with ARCH not being passed during try_compile
2021-04-15 06:44:55 +03:00
Victor Perevertkin
72ad37c1cd
[CMAKE] Unify configs for architectures
config*.cmake files are constantly getting out of sync between
each other. Besides that, the parameters are not really dependent
on a target architecture, but rather on a compiler (except *ARCH)

This approach seems to be more future-prone, and allows to see
all the options in one file (there are really not that many of them)
2021-04-15 06:44:52 +03:00
Jérôme Gardou
5d1ecc7575 [CMAKE] Define _SBCS when using VS generator
CORE-17423
2021-03-03 08:34:32 +01:00
Jérôme Gardou
49000c6471 [CMAKE] Disable policy CMP0091 and set /MT flag explicitly for Visual Studio generator 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
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
Hervé Poussineau
19779b3f96 [CMAKE] Our C code base is C99, so mark it as such.
This fixes 64211aa696, which mistakenly declared C11 as default.
2020-12-01 20:42:41 +01:00
Hervé Poussineau
64211aa696 [CMAKE] Declare that we want to use C11/C++11
That way, we won't use whatever standard is the default on whatever compiler we are using.
This should also prevent using more recent features without warning.
2020-12-01 18:51:42 +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
Timo Kreuzer
743c378ed1 [CMAKE] Add architecture to our build string
This introduces a new CMake variable WINARCH, which what Windows usually uses ("x86" instead of "i386") e.g. in sxs names.
2020-11-07 18:40:45 +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
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
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
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
980ce77316 [CMAKE] CMakeParseArguments is not needed anymore, cmake_parse_arguments is a builtin since CMake 3.5 2020-10-20 21:44:54 +02:00
Timo Kreuzer
280aa21179 [CMAKE] Add baseaddress_msvc_x64.cmake 2020-09-20 23:08:17 +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
dd6eb40381
[CMAKE] Remove work-arounds for old CMake versions. CORE-17109 2020-06-20 15:25:29 +02:00
Thomas Faber
a3a1d8f421
[CMAKE] Use CMake 3.17 default policies. CORE-17109 2020-06-20 15:25:28 +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
94073cc1d9
[CMAKE] Use NEW policy for CMP0058. 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
Victor Perevertkin
8639a131b0
[CMAKE] Fix build with CMake 3.17.1-ReactOS (RosBE 2.2) 2020-04-27 03:40:48 +03: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
Jérôme Gardou
5a8901130a [CMAKE] Fix symbol directory for non-MSVC builds 2020-03-30 07:54:21 +00:00
Dmitry Borisov
c14cc22bfd [FREELDR] Add ARC-emulation support for NEC PC-98 series
- Add ARC-emulation support for NEC PC-98 series
- Add global definition for PC-98 port into CMakeLists.txt
- Add floppy verison of freeldr.ini for PC-98 CD boot
2020-03-07 00:52:40 +01:00
Stanislav Motylkov
f9e36df4d6 [CMAKE] Add proper global definition for Xbox port (#2250)
CORE-16216
2020-01-14 22:15:18 +01:00
Jérôme Gardou
493ceb7ade [CMAKE] Fix host tools build on x86-64 mingw
Dynamically check for sys/types.h and pid_t in wine config.h
Use TARGET_xxx defines instead of _X86_ as this is undefined by GCC
Add some sense in include directories management by using interface
libraries
2019-11-15 16:22:06 +01:00
Serge Gautherie
12dc1089ec [CMAKE] KDBG and _WINKD_ do not need a value 2019-08-17 18:40:40 +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
cd9f9e8b94 [CMAKE] Globally enable secure CRT functions
"This is what Windows does" (tm)
2019-07-20 13:56:18 +02:00
Timo Kreuzer
99fa38809f [STDUNK][PORTCLS][CMIDriver] Fix issue with operator new/delete
Fix for MSVC warning "C2323: 'operator new': non-member operator new or delete functions may not be declared static or in a namespace other than the global namespace."

See https://docs.microsoft.com/en-us/cpp/porting/visual-cpp-what-s-new-2003-through-2015?view=vs-2019 section "Overloaded operator new and operator delete"
2019-06-24 21:17:00 +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
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
Andrew Cook
d8e92b5a0a Merge pull request #1335 from ariscop/CMP0065
Fixes for upstream cmake
2019-02-03 12:57:20 +01:00