Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osquery_sdk_pluginsdk compiles /MD on Windows #6509

Closed
Breakwell opened this issue Jun 18, 2020 · 2 comments · Fixed by #6521
Closed

osquery_sdk_pluginsdk compiles /MD on Windows #6509

Breakwell opened this issue Jun 18, 2020 · 2 comments · Fixed by #6521

Comments

@Breakwell
Copy link
Contributor

Breakwell commented Jun 18, 2020

Bug report

What operating system and version are you using?

osquery> SELECT version, build, platform FROM os_version;
+------------+-------+----------+
| version | build | platform |
+------------+-------+----------+
| 10.0.17763 | 17763 | windows |
+------------+-------+----------+

What steps did you take to reproduce the issue?

Clone osquery on windows

Powershell:
C:\git\osquery> mkdir build; cd build
C:\git\osquery\build> cmake -G "Visual Studio 16 2019" -A x64 -T v141 .. -DOSQUERY_BUILD_TESTS=ON

What did you expect to see?

osquery_sdk-pluginsdk building with /MT

What did you see instead?

osquery_sdk-pluginsdk building with /MD

Description

I am unsure if this a bug or by design, osquery sdk (https://github.com/osquery/osquery/blob/master/osquery/sdk/CMakeLists.txt#L20) is generated without "osquery_cxx_settings" and ends up building as /MD. Is this intentional?

image

@theopolis
Copy link
Member

@Smjert, just to confirm, this looks like an oversight.

@Smjert
Copy link
Member

Smjert commented Jun 18, 2020

@theopolis definitely seems so, @Breakwell good find!

Smjert added a commit to trailofbits/osquery that referenced this issue Jun 24, 2020
Add a description to the function preparing the targets carrying the
main compiler and linker flags.

Convert CMake default flags to the ones we use, instead of overriding
them later via targets.
This can also avoid having us use the wrong CRT on Windows if we forget to link
against osquery_cxx_settings.

Reduce the "overriding <flagX> with <flagY>" messages on Windows by
removing the warning level from the default flags, and adding that
to the specific osquery_<c|cxx>_settings target, so that non internal
targets can choose their own level.

Minor cleanups

Fix osquery#6509
theopolis pushed a commit that referenced this issue Jun 25, 2020
Add a description to the function preparing the targets carrying the
main compiler and linker flags.

Convert CMake default flags to the ones we use, instead of overriding
them later via targets.
This can also avoid having us use the wrong CRT on Windows if we forget to link
against osquery_cxx_settings.

Reduce the "overriding <flagX> with <flagY>" messages on Windows by
removing the warning level from the default flags, and adding that
to the specific osquery_<c|cxx>_settings target, so that non internal
targets can choose their own level.

Minor cleanups

Fix #6509
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants