Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
don't include unistd.h on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrh committed Jul 17, 2016
1 parent 68d4709 commit 08c52d9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ SET(LEPTON_SOURCES
src/io/MemMgrAllocator.hh
)
add_executable(lepton ${LEPTON_SOURCES})
add_executable(lepton-avx ${LEPTON_SOURCES})
add_executable(lepton-slow-best-ratio ${LEPTON_SOURCES})
add_executable(lepton-avx ${LEPTON_SOURCES})
SET(ADDITIONAL_FLAGS)
IF(NOT APPLE)
IF(NOT WIN32)
Expand Down Expand Up @@ -208,14 +208,21 @@ include_directories(${ZLIB_INCLUDE_DIRS})
find_package(OpenSSL)
include_directories(${OPENSSL_INCLUDE_DIRS})
target_link_libraries(lepton ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${ADDITIONAL_FLAGS})
target_link_libraries(lepton-avx ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${ADDITIONAL_FLAGS})
target_link_libraries(lepton-slow-best-ratio ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${ADDITIONAL_FLAGS})
target_link_libraries(lepton-avx ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${ADDITIONAL_FLAGS})
ELSE()
target_link_libraries(lepton localzlib localmd5 ${ADDITIONAL_FLAGS})
target_link_libraries(lepton-avx localzlib localmd5 ${ADDITIONAL_FLAGS})
target_link_libraries(lepton-slow-best-ratio localzlib localmd5 ${ADDITIONAL_FLAGS})
target_link_libraries(lepton-avx localzlib localmd5 ${ADDITIONAL_FLAGS})
set_target_properties(localmd5 PROPERTIES COMPILE_FLAGS "-msse4.2 ${ADDITIONAL_COMPILE_FLAGS} ${ADDITIONAL_DEFINES}")
set_target_properties(localzlib PROPERTIES COMPILE_FLAGS "-msse4.2 -include unistd.h ${ADDITIONAL_COMPILE_FLAGS} ${ADDITIONAL_DEFINES}")

IF(WIN32)
SET(ZLIB_EXTRA_INCLUDE_DIRS)
ELSE()
SET(ZLIB_EXTRA_INCLUDE_DIRS " -include unistd.h")
ENDIF()

set_target_properties(localzlib PROPERTIES COMPILE_FLAGS "-msse4.2 ${ZLIB_EXTRA_INCLUDE_DIRS} ${ADDITIONAL_COMPILE_FLAGS} ${ADDITIONAL_DEFINES}")
ENDIF()
set_target_properties(lepton PROPERTIES COMPILE_FLAGS "-msse4.2 ${ADDITIONAL_COMPILE_FLAGS} ${ADDITIONAL_DEFINES}")
set_target_properties(lepton-slow-best-ratio PROPERTIES COMPILE_FLAGS "-msse4.2 ${ADDITIONAL_COMPILE_FLAGS} ${ADDITIONAL_DEFINES} -DDEFAULT_SINGLE_THREAD")
Expand Down Expand Up @@ -281,4 +288,4 @@ ADD_CUSTOM_TARGET(

ADD_DEPENDENCIES(lepton version)

install (TARGETS lepton lepton-avx lepton-slow-best-ratio DESTINATION bin)
install (TARGETS lepton lepton-slow-best-ratio lepton-avx DESTINATION bin)

0 comments on commit 08c52d9

Please sign in to comment.