fix useless getopt.h check (#424)

* link fix when using lsquic in a cpp project

* Update CMakeLists.txt

* Fix getopt.h error when not needed

Co-authored-by: MBellahcene <moussa.bellahcene@4d.com>
This commit is contained in:
M-BELLAHCENE 2022-09-29 15:15:30 +02:00 committed by GitHub
parent 5c669eea50
commit 108c4e7629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -231,8 +231,8 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
link_directories( /usr/local/lib )
ENDIF()
IF (CMAKE_SYSTEM_NAME STREQUAL Windows)
FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h AND LSQUIC_TESTS AND LSQUIC_BIN)
IF (CMAKE_SYSTEM_NAME STREQUAL Windows AND LSQUIC_TESTS AND LSQUIC_BIN)
FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h)
IF (GETOPT_INCLUDE_DIR)
INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR})
ELSE()