Skip to content

Conversation

@abmusse
Copy link
Contributor

@abmusse abmusse commented Jun 12, 2020

For now we want to always compile without optimizations because
we found that using -O2 causes issues selecting data from tables.
Uur mariadb.spec adds -O2 to CMAKE_CXX_FLAGS_RELWITHDEBINFO
when the build type is RELWITHDEBINFO (which is the default).
This then causes this storage engine to build with -O2
optimizations becuase CMAKE_CXX_FLAGS_RELWITHDEBINFO are
added to the end of CMAKE_CXX_FLAGS.

We can work around this issue by appending -O0 to
CMAKE_CXX_FLAGS_RELWITHDEBINFO which will then cause -O0
to override the -O2 set previously but this pollutes the
global CMAKE_CXX_FLAGS_RELWITHDEBINFO variable and causes everything
to be built unoptimized. Instead we can use target_compile_options
which only pass compile options for this target.

The second commit:

Removes setting CMAKE_C_FLAGS because this project only contains c++ source files
and we do not want to pollute the global CMAKE_C_FLAGS variable.

abmusse added 2 commits June 12, 2020 18:17
For now we want to always compile without optimizations because
we found that using `-O2` causes issues selecting data from tables.
Uur mariadb.spec adds `-O2` to CMAKE_CXX_FLAGS_RELWITHDEBINFO
when the build type is RELWITHDEBINFO (which is the default).
This then causes this storage engine to build with -O2
optimizations becuase CMAKE_CXX_FLAGS_RELWITHDEBINFO are
added to the end of CMAKE_CXX_FLAGS.

We can work around this issue by appending -O0 to
CMAKE_CXX_FLAGS_RELWITHDEBINFO which will then cause -O0
to override the -O2 set previously but this pollutes the
global CMAKE_CXX_FLAGS_RELWITHDEBINFO variable and causes everything
to be built unoptimized. Instead we can use target_compile_options
which only pass compile options for this target.
Do not pollute the global CMAKE_C_FLAGS variable.
Also this project only contains c++ source files.
@abmusse abmusse marked this pull request as ready for review June 15, 2020 16:32
@ThePrez ThePrez merged commit b4793f3 into zendtech:master Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants