<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - libcxx/src/CMakeLists.txt includes thread_win32.cpp regardless of LIBCXX_HAS_WIN32_THREAD_API"
   href="https://bugs.llvm.org/show_bug.cgi?id=46465">46465</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libcxx/src/CMakeLists.txt includes thread_win32.cpp regardless of LIBCXX_HAS_WIN32_THREAD_API
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>usaonmonday@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>libcxx/src/CMakeLists.txt has the following fragment:

if(WIN32)
  list(APPEND LIBCXX_SOURCES
    support/win32/locale_win32.cpp
    support/win32/support.cpp
    support/win32/thread_win32.cpp
    )

If LIBCXX_HAS_PTHREAD_API is ON and LIBCXX_HAS_WIN32_THREAD_API is OFF (MINGW),
this causes linker errors.

It should be:

if(WIN32)
  list(APPEND LIBCXX_SOURCES
    support/win32/locale_win32.cpp
    support/win32/support.cpp
    )
  if (LIBCXX_HAS_WIN32_THREAD_API)
    list(APPEND LIBCXX_SOURCES
      support/win32/thread_win32.cpp
      )
  endif()</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>