Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
phc-winner-argon2 CMake
cmake_minimum_required(VERSION 3.3)
project(phc_winner_argon2)
set(SOURCE_FILES
src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c)
set(SRC_RUN src/run.c)
set(SRC_BENCH src/bench.c)
set(SRC_GENKAT src/genkat.c)
set(RUN argon2)
set(BENCH bench)
set(GENKAT genkat)
set(DIST phc-winner-argon2)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LIB_EXT so)
set(LIB_CFLAGS -shared -fPIC)
set(LIB_PATH -Wl,-rpath=${BUILD_PATH})
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
set(LIB_EXT so)
set(LIB_CFLAGS -shared -fPIC)
set(LIB_PATH -Wl,-rpath=${BUILD_PATH})
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LIB_EXT dylib)
set(LIB_CFLAGS -dynamiclib -install_name @rpath/lib${LIB_NAME}.${LIB_EXT})
set(LIB_PATH -Xlinker -rpath -Xlinker ${BUILD_PATH})
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD" OR
${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(LIB_EXT so)
set(LIB_CFLAGS -shared -fPIC)
set(LIB_PATH -Wl,-rpath=${BUILD_PATH})
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "MINGW")
set(LIB_EXT dll)
set(LIB_CFLAGS -shared -Wl,--out-implib,lib${LIB_NAME}.${LIB_EXT}.a)
set(LIB_PATH -Wl,-rpath=${BUILD_PATH})
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LIB_SH lib${LIB_NAME}.${LIB_EXT})
set(LIB_ST lib${LIB_NAME}.a)
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS}
-std=c89 -pthread
-O3 -Wall -g"
$(CFLAGS) $^ -Isrc -o ${DIST})
add_executable(phc_winner_argon2 ${SOURCE_FILES})
@SamuelMarks

This comment has been minimized.

Copy link
Owner Author

commented Nov 17, 2015

Oh, all the BSDs have the same arguments -_-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.