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

Mingw #2

Open
wants to merge 98 commits into
base: cmake
Choose a base branch
from
Open

Mingw #2

wants to merge 98 commits into from

Conversation

bscottm
Copy link

@bscottm bscottm commented Aug 25, 2019

Renamed "gnu_compiler" branch to "mingw" (works better when using CMake's ExternalPackage_Add)

Joel Winarske and others added 22 commits October 15, 2018 16:00
Add MinGW GNU compiler support. Also update CMake minimum version, since
some of the newer generator features are used.
If CMAKE_INSTALL_PREFIX defaults (not set) on initial run, nail the
prefix to ${CMAKE_SOURCE_DIR}/PTHREADS-BUILT. And make sure it persists
across subsequent runs.

Also found a minor cleanup when setting target compile flags.
Fix GCC warning about "char *" used with immutable strings. It's also a
bad idea to cast a pointer to int. Use ptrdiff_t instead.
Use PRIVATE for all target defines, libraries, options, etc.
PUBLIC ends up adding extra flags to library dependents because it
alters the INTERFACE and PRIVATE target properties at the same time. So,
if libpthreadGC3 gets build with __PTW32_BUILD and that definition is
added to the libpthreadGC3 target (target_compile_definitions) with
PUBLIC, the test cases inherit the __PTW32_BUILD define. It's almost
worse than using add_compile_definitions.

Punchline: Localize target flags, definitions, options and libraries
using PRIVATE.

Note: 100% of the tests pass for GNU x64. Some fail for x86. This can be
attributed to the difference in C++ exception handling. x64 uses SEH,
x86 uses SJLJ.
- Generate config.h in ${CMAKE_BINARY_DIR} instead of overwriting
  config.h in the top-level source directory. Arrange the include
  directory list to ensure it gets picked up before the top-level.
- Fat finger? Install tests for VC from the appropriate configuration
  subdirectory.
…mingw

Also, workaround the new CMake source enforcement "feature", where CMake
actually embeds the source type on the MSVC command line (i.e., "/TC"
for C source, "/TP" for C++ source.)
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.

None yet

2 participants