Skip to content

Commit

Permalink
fixtypo compiler names
Browse files Browse the repository at this point in the history
Everywhere cmake, qmake, docs, ...
  • Loading branch information
silverqx committed Jun 25, 2024
1 parent 305650f commit 31b8e06
Show file tree
Hide file tree
Showing 46 changed files with 94 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-qt6-drivers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
runnerWorkPath=$(realpath "$RUNNER_WORKSPACE/..")
echo "TinyRunnerWorkPath=$runnerWorkPath" >> $GITHUB_ENV
# Parallel gcc to 3 and clang to 8 is maximum what my computer allows but I decided to use
# Parallel gcc to 3 and Clang to 8 is maximum what my computer allows but I decided to use
# the different strategy, I will use the on: workflow_dispatch for all self-hosted actions
# and these workflows are invoked automatically one from other:
# gh workflow run --ref silverqx-develop
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/msys2-ucrt64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
env:
# Settings (constant variables)
# First value is a compressed data size
# gcc: ~ 180 * 3 + 100 ; clang: ~ 140 * 3 + 100
# GCC: ~ 180 * 3 + 100 ; clang: ~ 140 * 3 + 100
TINY_CCACHE_MAX_SIZE_GCC: 640M
TINY_CCACHE_MAX_SIZE_CLANG: 520M
# Clang and vcpkg uses $env:NUMBER_OF_PROCESSORS
Expand Down
10 changes: 5 additions & 5 deletions NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ inline constants:
- related issue: https://github.com/llvm/llvm-project/issues/55938
- clang-cl shared build crashes with extern constants, so force to inline constants 😕🤔
- don't show INLINE_CONSTANTS cmake option and provide the default value ON using feature_option_dependent(INLINE_CONSTANTS) depends option, so inline constants is the default
- so inline constants are only one option with clang-cl
- so inline constants are only one option with Clang-cl

- qmake
- normal behavior is that user can switch between inline and extern constants using the inline_constants/extern_constants qmake CONFIG option
Expand All @@ -1547,12 +1547,12 @@ inline constants:
- MinGW clang static build is not supported, contains a problem with duplicit symbols, this build type is disabled
- qmake error() is thrown with a nice message
- cmake compiles ok but crashes in this scenario
- clang-cl shared build crashes with extern constants, so force to inline constants 😕🤔
- Clang-cl shared build crashes with extern constants, so force to inline constants 😕🤔
- when is shared build then inline_constants qmake CONFIG option is set (this is the default)
- when user set extern_constants then qmake error() is thrown with nice message (I have removed this correction logic)
- so inline constants are only one option with clang-cl
- so inline constants are only one option with Clang-cl

The conclusion is that the funckin string constants 💥, it was bearable until I have added the clang-cl MSVC support.
The conclusion is that the funckin string constants 💥, it was bearable until I have added the Clang-cl MSVC support.
Clang under <v18 is full of bugs, the same is true for lld. Huge amount of problems were fixed before 14-18.
I think is the time to try Clang libc++ std library again and give it a try, but I don't believe I compile basic code, last time I tried I had a problems with hello world. 😅

Expand Down Expand Up @@ -2623,7 +2623,7 @@ Compilation time and Memory usage:
- Qt 6.2.4
MSVC2019 9.9GB 1:27
MSVC2022 8.0GB 1:25
clang-cl MSVC2022 5.5GB 1:35
Clang-cl MSVC2022 5.5GB 1:35


bugs:
Expand Down
12 changes: 6 additions & 6 deletions cmake/CommonModules/TinyCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ ${TINY_UNPARSED_ARGUMENTS}")

# clang-cl.exe notes:
# /RTC - https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130902/088105.html
# /bigobj - clang-cl uses it by default - https://reviews.llvm.org/D12981
# /bigobj - Clang-cl uses it by default - https://reviews.llvm.org/D12981
if(MSVC)
# Common for MSVC and clang-cl
# Common for MSVC and Clang-cl
target_compile_options(${target} INTERFACE
# Suppress banner and info messages
/nologo
# Is safer to provide this explicitly, qmake do it for msvc too
# Is safer to provide this explicitly, qmake do it for MSVC too
/EHsc
/utf-8
# Has to be enabled explicitly
Expand All @@ -139,7 +139,7 @@ ${TINY_UNPARSED_ARGUMENTS}")
# Set by default by c++20 but from VS 16.11, can be removed when
# minMsvcReqVersion will be >= 16.11
/permissive-
# clang-cl 16 throws -Wunused-command-line-argument, so provide it
# Clang-cl 16 throws -Wunused-command-line-argument, so provide it
# only for the MSVC
/guard:cf
/bigobj
Expand Down Expand Up @@ -203,7 +203,7 @@ ${TINY_UNPARSED_ARGUMENTS}")
endif()

target_compile_options(${target} INTERFACE
# -fexceptions for linux is not needed, it is on by default
# -fexceptions for Linux is not needed, it is on by default
-Wall
-Wextra
# Weffc++ is outdated, it warnings about bullshits 🤬, even word about this
Expand Down Expand Up @@ -242,7 +242,7 @@ ${TINY_UNPARSED_ARGUMENTS}")
endif()
endif()

# Use faster lld linker on Clang (target the Clang except clang-cl with MSVC)
# Use faster lld linker on Clang (target the Clang except Clang-cl with MSVC)
# Don't set for MINGW to avoid duplicate setting (look a few lines above)
# TODO use LINKER_TYPE target property when min. version will be CMake v3.29 silverqx
if(NOT MINGW AND NOT MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
Expand Down
18 changes: 9 additions & 9 deletions cmake/CommonModules/TinyHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Visual Studio")
endif()
endif()

# clang-cl
# Clang-cl
if(MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"
)
Expand All @@ -50,7 +50,7 @@ Visual Studio")
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS TINY_CLANG_CL)
message(FATAL_ERROR "Minimum required clang-cl version was not satisfied, \
message(FATAL_ERROR "Minimum required Clang-cl version was not satisfied, \
required version >=${TINY_CLANG_CL}, your version is ${CMAKE_CXX_COMPILER_VERSION}, \
upgrade LLVM")
endif()
Expand Down Expand Up @@ -377,7 +377,7 @@ endfunction()
# contains ccache/sccache (fixes for MSVC compilers)
function(tiny_should_fix_ccache_msvc out_variable)

# Target the msvc and clang-cl with msvc compilers on Windows
# Target the MSVC and Clang-cl with MSVC compilers on Windows
if(NOT WIN32 OR NOT MSVC OR MINGW OR NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
set(${out_variable} FALSE PARENT_SCOPE)
return()
Expand All @@ -392,8 +392,8 @@ function(tiny_should_fix_ccache_msvc out_variable)
endfunction()

# Determine whether to disable PCH based on the ccache --print-version and set
# the internal cache variable TINY_CCACHE_VERSION (msvc only)
# Precompiled headers are fully supported on msvc for ccache >=4.10, so
# the internal cache variable TINY_CCACHE_VERSION (MSVC only)
# Precompiled headers are fully supported on MSVC for ccache >=4.10, so
# disable PCH for ccache <4.10 only.
# The git-ref is a special value, it means that the ccache was built manually from eg.
# master branch, in this case suppose the version is always >=4.10.
Expand All @@ -413,7 +413,7 @@ function(tiny_should_disable_precompile_headers out_variable)
return()
endif()

set(helpString "Ccache version used to determine whether to disable PCH (msvc only).")
set(helpString "Ccache version used to determine whether to disable PCH (MSVC only).")

execute_process(
COMMAND "${CMAKE_CXX_COMPILER_LAUNCHER}" --print-version
Expand Down Expand Up @@ -624,7 +624,7 @@ endfunction()
# contains ccache/sccache (fixes for Clang compilers)
function(tiny_should_fix_ccache_clang out_variable)

# Target the Clang on Linux, MSYS2, and also clang-cl with MSVC
# Target the Clang on Linux, MSYS2, and also Clang-cl with MSVC
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(${out_variable} FALSE PARENT_SCOPE)
return()
Expand All @@ -645,15 +645,15 @@ function(tiny_fix_ccache)

# MSYS2 g++ or clang++ work well with the precompiled headers but the msvc doesn't

# Fixes for the MSVC compiler (including the clang-cl with MSVC)
# Fixes for the MSVC compiler (including the Clang-cl with MSVC)
set(shouldFixCcacheMsvc FALSE)
tiny_should_fix_ccache_msvc(shouldFixCcacheMsvc)

if(shouldFixCcacheMsvc)
tiny_fix_ccache_msvc()
endif()

# Fixes for the Clang compiler on Linux, MSYS2, and also clang-cl with MSVC
# Fixes for the Clang compiler on Linux, MSYS2, and also Clang-cl with MSVC
# Ignore PCH timestamps if the ccache is used (recommended in ccache docs)
set(shouldFixCcacheClang FALSE)
tiny_should_fix_ccache_clang(shouldFixCcacheClang)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/TinyOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ include(TinyFeatureOptions)

# Initialize INLINE_CONSTANTS CMake feature dependent option.
# MinGW Clang shared build crashes with inline constants (fixed in Clang v18).
# clang-cl shared build crashes with extern constants so force to inline constants 😕🤔
# (also fixed in Clang v18), only one option with the clang-cl is inline constants
# Clang-cl shared build crashes with extern constants so force to inline constants 😕🤔
# (also fixed in Clang v18), only one option with the Clang-cl is inline constants
# for both shared/static builds.
# Look at NOTES.txt[inline constants] how this funckin machinery works. 😎
# Related issue: https://github.com/llvm/llvm-project/issues/55938
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/TinyTestCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ${TINY_UNPARSED_ARGUMENTS}")
)

# These two settings allow to run tests in parallel using eg.: ctest --parallel 10
# Parallel 30 saves ~12s on msvc (from 42s to 30s)
# Parallel 30 saves ~12s on MSVC (from 42s to 30s)
set_tests_properties(${name} PROPERTIES RUN_SERIAL ${TINY_RUN_SERIAL})

# Primarily to depend all functional tests on unit tests
Expand Down
2 changes: 1 addition & 1 deletion docs/building/migrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ target_link_libraries(${Tom_target}

### Build migrations {#build-migrations-cmake}

Now you are ready to configure `tom` `CMake` application. Don't forget to prepare the build environment with the [`qtenv6.ps1`](building/tinyorm.mdx#windows-prerequisites) command if you are building with the `msvc`.
Now you are ready to configure `tom` `CMake` application. Don't forget to prepare the build environment with the [`qtenv6.ps1`](building/tinyorm.mdx#windows-prerequisites) command if you are building with the `MSVC`.

```bash
cd ../tom-builds-cmake/build-debug
Expand Down
4 changes: 2 additions & 2 deletions docs/building/tinyorm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ These variables will be set after the configuration is done:
| ----------------------------- | ----------- |
| `TINY_BUILD_SUBFOLDER` | Folder by release type if `CONFIG+=debug_and_release` is defined <small>(/debug, /release, or an empty string)</small>. |
| `TINY_CCACHE_BUILD` | To correctly link `ccache` build against a `ccache` build <small>(_ccache or an empty string)</small>. |
| `TINY_MSVC_VERSION` | The `msvc` compiler string <small>(MSVC2022 or MSVC2019)</small>. |
| `TINY_MSVC_VERSION` | The `MSVC` compiler string <small>(MSVC2022 or MSVC2019)</small>. |
| `TINY_QT_VERSION_UNDERSCORED` | Underscored `Qt` version <small>(eg. 6_7_2)</small>. |
| `TINY_RELEASE_TYPE_CAMEL` | Build type string <small>(Debug, Profile, or Release)</small>. |
| `TINY_VCPKG_INCLUDE` | Path to the `vcpkg` `include` folder <small>(vcpkg/installed/&lt;triplet&gt;/include/)</small>. |
Expand Down Expand Up @@ -1013,7 +1013,7 @@ On Linux `-isystem` marks the directory as a system directory, it prevents warni

On Windows you can use `QMAKE_CXXFLAGS_WARN_ON = -external:anglebrackets -external:W0`, it applies a warning level 0 to the angel bracket includes; `#include <file>`.

With the `clang-cl` with `MSVC` you can use `-imsvc`.
With the `Clang-cl` with `MSVC` you can use `-imsvc`.
:::

### Auto-configuration internals
Expand Down
2 changes: 1 addition & 1 deletion docs/supported-compilers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Following compilers are backed up by the GitHub Action [workflows](https://githu
- MSVC 2022 `>=17`
- MSYS2 UCRT64 GCC `10.2` - `14.1`
- MSYS2 UCRT64 Clang `>=15`
- clang-cl `>=15` with MSVC 2019/2022
- Clang-cl `>=15` with MSVC 2019/2022

#### `Linux`

Expand Down
6 changes: 3 additions & 3 deletions docs/tinyorm/casts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ Attributes that are `null` __will also be__ cast so that the `QVariant`'s intern

By default, TinyORM will cast the `created_at` and `updated_at` columns to instances of `QDateTime`. You may cast additional date attributes by defining additional date casts within your model's `u_casts` static data member unordered map. Typically, dates should be cast using the `CastType::QDateTime`, `CastType::QDate`, or `CastType::Timestamp` cast types.

When a database column is of the date type, you may set the corresponding model attribute value to a UNIX timestamp, date string (`Y-m-d`), date-time string, `QDate`, or `QDateTime` instance. The date's value will be correctly converted and stored in your database.<br/>
The same is true for the datetime or timestamp database column types, you can set the corresponding model attribute value to a UNIX timestamp, date-time string, or a `QDateTime` instance.
When a database column is of the date type, you may set the corresponding model attribute value to a Unix timestamp, date string (`Y-m-d`), date-time string, `QDate`, or `QDateTime` instance. The date's value will be correctly converted and stored in your database.<br/>
The same is true for the datetime or timestamp database column types, you can set the corresponding model attribute value to a Unix timestamp, date-time string, or a `QDateTime` instance.

When defining the `CastType::QDate` or `CastType::QDateTime` cast, you may also specify the date's format. In this case you must use the `CastType::CustomQDate` or `CastType::CustomQDateTime` cast types. This format will be used when the [model is serialized to a vector, map, or JSON](tinyorm/serialization.mdx):

Expand Down Expand Up @@ -279,7 +279,7 @@ To specify the format that should be used when actually storing a model's dates
inline static QString u_dateFormat {QLatin1Char('U')};
```

This format can be any format that the QDateTime's `fromString` or `toString` methods accept or the special `U` format that represents the UNIX timestamp (this `U` format is TinyORM-specific and isn't supported by `QDateTime`).
This format can be any format that the QDateTime's `fromString` or `toString` methods accept or the special `U` format that represents the Unix timestamp (this `U` format is TinyORM-specific and isn't supported by `QDateTime`).

Define a `u_timeFormat` data member on your model to specify the format that should be used when storing a model's times within your database:

Expand Down
6 changes: 3 additions & 3 deletions docs/tinyorm/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,15 @@ The default value for datetime or timestamp columns is `yyyy-MM-dd HH:mm:ss` and
##### Unix timestamps
You can set the `u_dateFormat` to `U` if you want to store dates in the database as unix timestamps:
You can set the `u_dateFormat` to `U` if you want to store dates in the database as Unix timestamps:
```cpp
QString u_dateFormat {QLatin1Char('U')};
```

In this case __all__ date attributes set in the `u_dates` will be handled as unix timestamps, so also the `created_at` and `updated_at` timestamp attributes.
In this case __all__ date attributes set in the `u_dates` will be handled as Unix timestamps, so also the `created_at` and `updated_at` timestamp attributes.

To create unix timestamp columns using the [tom migrations](/database/migrations.mdx) you should use `integer` types:
To create Unix timestamp columns using the [tom migrations](/database/migrations.mdx) you should use `integer` types:

```cpp
Schema::table("flights", [](Blueprint &table)
Expand Down
4 changes: 2 additions & 2 deletions drivers/common/include_private/orm/drivers/config_p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#if defined(TINYDRIVERS_EXTERN_CONSTANTS) && defined(TINYDRIVERS_INLINE_CONSTANTS)
# error Both TINYDRIVERS_EXTERN_CONSTANTS and TINYDRIVERS_INLINE_CONSTANTS defined.
#endif
/* clang-cl shared build crashes with extern constants, force to inline constants. 😕🤔
Only one option with the clang-cl is inline constants for both shared/static builds.
/* Clang-cl shared build crashes with extern constants, force to inline constants. 😕🤔
Only one option with the Clang-cl is inline constants for both shared/static builds.
Look at NOTES.txt[inline constants] how this funckin machinery works. 😎 */
#if !defined(TINYDRIVERS_INLINE_CONSTANTS) && defined(_MSC_VER) && defined(__clang__)
# undef TINYDRIVERS_EXTERN_CONSTANTS
Expand Down
2 changes: 1 addition & 1 deletion drivers/mysql/resources/TinyMySql.rc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#pragma code_page(@pragma_codepage@) // DEFAULT for msvc >=Qt6 and UTF-8 in any other case
#pragma code_page(@pragma_codepage@) // DEFAULT for MSVC >=Qt6 and UTF-8 in any other case

//IDI_ICON1 ICON "icons/@[email protected]"

Expand Down
2 changes: 1 addition & 1 deletion include/orm/macros/compilerdetect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TINY_SYSTEM_HEADER
// Used compiler
// Must be before GNU, because clang claims to be GNU too
#ifdef __clang__
// Apple clang has other version numbers
// Apple Clang has other version numbers
# ifdef __apple_build_version__
# define TINYORM_COMPILER_STRING "Clang " __clang_version__ " (Apple)"
# else
Expand Down
2 changes: 1 addition & 1 deletion include/orm/schema/columndefinition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ namespace Orm::SchemaNs
I have decided not to use polymorphic commands, I wanted to use
designated initializers with aggregates, the consequence of this is
usage of reinterpret_cast() :/, but it works great.
I had to reject designated initializers with commands because of gcc throws
I had to reject designated initializers with commands because of GCC throws
-Wmissing-field-initializers warning with aggregates that have a base class
even empty base class, so I had to use classic aggregate initialization with
commands, it's not a big deal as all data members of commands have to be
Expand Down
14 changes: 7 additions & 7 deletions include/orm/tiny/concerns/hasattributes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ namespace Orm::Tiny::Concerns
inline QDate asDate(const QVariant &value) const;
/*! Return a timestamp as QTime object. */
inline QTime asTime(const QVariant &value) const;
/*! Return a timestamp as unix timestamp. */
/*! Return a timestamp as Unix timestamp. */
inline qint64 asTimestamp(const QVariant &value) const;

/*! Return a timestamp as QDateTime or QDate object. */
Expand Down Expand Up @@ -1040,7 +1040,7 @@ namespace Orm::Tiny::Concerns
if (value.isNull())
return nullFor_fromDateTime(value, format);

// Support unix timestamps
// Support Unix timestamps
if (format == QLatin1Char('U')) T_UNLIKELY
return asTimestamp(value);

Expand Down Expand Up @@ -1069,8 +1069,8 @@ namespace Orm::Tiny::Concerns

const auto &format = getDateFormat();

// Support unix timestamps
/* This should be templated and for the unix timestamps the return type should be
// Support Unix timestamps
/* This should be templated and for the Unix timestamps the return type should be
qint64, but it would make the code more complex because I would have to move
the getDateFormat() outside, so I will simply return QString, it's not a big
deal, INSERT/UPDATE clauses with '1604xxx' for the bigint columns are totaly
Expand Down Expand Up @@ -1716,9 +1716,9 @@ namespace Orm::Tiny::Concerns

const auto valueString = value.value<QString>();

/* If this value is an integer, we will assume it is a UNIX timestamp's value
/* If this value is an integer, we will assume it is a Unix timestamp's value
and format a QDateTime object from this timestamp. This allows flexibility
when defining your date fields as they might be UNIX timestamps here. */
when defining your date fields as they might be Unix timestamps here. */
if (StringUtils::isNumber(valueString))
// TODO switch ms accuracy? For the u_dateFormat too? silverqx
if (auto unixTimestamp = QDateTime::fromSecsSinceEpoch(value.value<qint64>());
Expand Down Expand Up @@ -2616,7 +2616,7 @@ namespace Orm::Tiny::Concerns
if (isCustomDateCastType(castItem)) {
const auto castModifier = castItem.modifier().template value<QString>();

// Support unix timestamps
// Support Unix timestamps
if (castModifier == QLatin1Char('U')) {
value = asTimestamp(value);
return;
Expand Down
Loading

0 comments on commit 31b8e06

Please sign in to comment.