Link to ws2_32 more consistently.

This fixes a couple issues:

- Which libraries to use should be based on WIN32, not MSVC.

- Windows libraries can be specified by #pragma comment lines in the
  source or by build dependencies. We specified #pragma lines in
  source, but also have build dependencies in crypto_test, etc. The
  latter was missing bssl.

  The comment line should be sufficient, but being explicit is useful,
  so fill in the missing one. This should help building with MINGW,
  which is missing support for the usual Windows pragma.

Change-Id: Ide9328c7dd306738ebbb0792e47da96948fe12f4
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/42105
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
chromium-5359
David Benjamin 4 years ago committed by CQ bot account: commit-bot@chromium.org
parent de196121b0
commit 8f88b27d6a
  1. 2
      crypto/CMakeLists.txt
  2. 4
      tool/CMakeLists.txt
  3. 6
      util/generate_build_files.py

@ -456,7 +456,7 @@ endif()
SET_TARGET_PROPERTIES(crypto PROPERTIES LINKER_LANGUAGE C)
if(NOT MSVC AND NOT ANDROID)
if(NOT WIN32 AND NOT ANDROID)
target_link_libraries(crypto pthread)
endif()

@ -23,6 +23,10 @@ add_executable(
add_dependencies(bssl global_target)
if(WIN32)
target_link_libraries(bssl ws2_32)
endif()
if(APPLE OR WIN32 OR ANDROID)
target_link_libraries(bssl ssl crypto)
else()

@ -608,10 +608,14 @@ endif()
self.PrintExe(cmake, 'bssl', files['tool'], ['ssl', 'crypto'])
cmake.write(
R'''if(NOT MSVC AND NOT ANDROID)
R'''if(NOT WIN32 AND NOT ANDROID)
target_link_libraries(crypto pthread)
endif()
if(WIN32)
target_link_libraries(bssl ws2_32)
endif()
''')
def FindCMakeFiles(directory):

Loading…
Cancel
Save