Skip to content

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.
@jwinarske jwinarske force-pushed the cmake branch 2 times, most recently from 08c3881 to d0530d2 Compare July 9, 2020 14:42
…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.

2 participants