2012-11-30 03:27:02 +04:00
|
|
|
# synergy -- mouse and keyboard sharing utility
|
2014-11-02 15:12:05 +03:00
|
|
|
# Copyright (C) 2013 Synergy Si Ltd.
|
2012-11-30 03:27:02 +04:00
|
|
|
#
|
|
|
|
# This package is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# found in the file COPYING that should have accompanied this file.
|
|
|
|
#
|
|
|
|
# This package is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2013-04-11 04:36:45 +04:00
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2012-11-30 03:27:02 +04:00
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2013-04-11 04:36:45 +04:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2012-11-30 03:27:02 +04:00
|
|
|
|
2013-05-31 18:55:22 +04:00
|
|
|
set(cryptopp_dir cryptopp562)
|
2012-11-30 05:07:04 +04:00
|
|
|
|
2013-05-31 18:55:22 +04:00
|
|
|
# only compile the crypto++ files we need.
|
|
|
|
set(cryptopp_src
|
|
|
|
${cryptopp_dir}/3way.cpp
|
|
|
|
${cryptopp_dir}/algparam.cpp
|
|
|
|
${cryptopp_dir}/asn.cpp
|
|
|
|
${cryptopp_dir}/authenc.cpp
|
|
|
|
${cryptopp_dir}/basecode.cpp
|
|
|
|
${cryptopp_dir}/cpu.cpp
|
|
|
|
${cryptopp_dir}/cryptlib.cpp
|
2013-06-04 22:22:58 +04:00
|
|
|
${cryptopp_dir}/des.cpp
|
|
|
|
${cryptopp_dir}/dessp.cpp
|
2013-05-31 18:55:22 +04:00
|
|
|
${cryptopp_dir}/dll.cpp
|
|
|
|
${cryptopp_dir}/ec2n.cpp
|
|
|
|
${cryptopp_dir}/ecp.cpp
|
|
|
|
${cryptopp_dir}/filters.cpp
|
|
|
|
${cryptopp_dir}/fips140.cpp
|
|
|
|
${cryptopp_dir}/gcm.cpp
|
|
|
|
${cryptopp_dir}/gf2n.cpp
|
|
|
|
${cryptopp_dir}/gfpcrypt.cpp
|
|
|
|
${cryptopp_dir}/hex.cpp
|
|
|
|
${cryptopp_dir}/hmac.cpp
|
|
|
|
${cryptopp_dir}/hrtimer.cpp
|
|
|
|
${cryptopp_dir}/integer.cpp
|
|
|
|
${cryptopp_dir}/iterhash.cpp
|
|
|
|
${cryptopp_dir}/misc.cpp
|
|
|
|
${cryptopp_dir}/modes.cpp
|
|
|
|
${cryptopp_dir}/mqueue.cpp
|
|
|
|
${cryptopp_dir}/nbtheory.cpp
|
|
|
|
${cryptopp_dir}/oaep.cpp
|
|
|
|
${cryptopp_dir}/osrng.cpp
|
|
|
|
${cryptopp_dir}/pubkey.cpp
|
|
|
|
${cryptopp_dir}/queue.cpp
|
|
|
|
${cryptopp_dir}/randpool.cpp
|
|
|
|
${cryptopp_dir}/rdtables.cpp
|
|
|
|
${cryptopp_dir}/rijndael.cpp
|
|
|
|
${cryptopp_dir}/rng.cpp
|
|
|
|
${cryptopp_dir}/sha.cpp
|
|
|
|
)
|
2013-04-10 21:27:25 +04:00
|
|
|
|
2013-04-11 04:30:41 +04:00
|
|
|
# if 64-bit windows, compile asm file.
|
|
|
|
if (CMAKE_CL_64)
|
2013-05-31 18:55:22 +04:00
|
|
|
list(APPEND cryptopp_src ${cryptopp_dir}/x64dll.asm ${cryptopp_dir}/x64masm.asm)
|
2013-04-11 04:30:41 +04:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT $(IntDir)x64dll.obj
|
|
|
|
COMMAND ml64.exe /c /nologo /Fo$(IntDir)x64dll.obj /Zi
|
2013-05-31 18:55:22 +04:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${cryptopp_dir}/x64dll.asm"
|
|
|
|
MAIN_DEPENDENCY ${cryptopp_dir}/x64dll.asm
|
2013-04-11 04:30:41 +04:00
|
|
|
VERBATIM)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT $(IntDir)x64masm.obj
|
|
|
|
COMMAND ml64.exe /c /nologo /Fo$(IntDir)x64masm.obj /Zi
|
2013-05-31 18:55:22 +04:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/${cryptopp_dir}/x64masm.asm"
|
|
|
|
MAIN_DEPENDENCY ${cryptopp_dir}/x64masm.asm
|
2013-04-11 04:30:41 +04:00
|
|
|
VERBATIM)
|
2013-04-05 04:01:54 +04:00
|
|
|
endif()
|
|
|
|
|
2013-04-11 06:41:56 +04:00
|
|
|
if (UNIX)
|
2013-04-11 07:18:40 +04:00
|
|
|
add_definitions(-DCRYPTOPP_DISABLE_ASM)
|
2013-04-11 06:41:56 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O2 -pipe")
|
|
|
|
|
|
|
|
if (APPLE)
|
2013-04-11 07:18:40 +04:00
|
|
|
if (DARWIN_VERSION GREATER 10)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-compare")
|
|
|
|
endif()
|
2013-04-11 06:41:56 +04:00
|
|
|
else()
|
2014-03-20 23:24:24 +04:00
|
|
|
set(CRYPTOPP_ARCH "native")
|
|
|
|
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^arm.*")
|
|
|
|
set(CRYPTOPP_ARCH "armv6zk")
|
|
|
|
endif()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${CRYPTOPP_ARCH}")
|
2013-04-11 06:41:56 +04:00
|
|
|
endif()
|
2013-04-05 02:38:07 +04:00
|
|
|
endif()
|
|
|
|
|
2013-05-31 18:55:22 +04:00
|
|
|
add_library(cryptopp STATIC ${cryptopp_src})
|
2014-02-24 20:32:18 +04:00
|
|
|
|
|
|
|
if (UNIX)
|
|
|
|
# ignore warnings in crypto++
|
|
|
|
set_target_properties(cryptopp PROPERTIES COMPILE_FLAGS "-w")
|
|
|
|
endif()
|