aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Lombrozo <elombrozo@gmail.com>2014-02-10 21:29:47 +0800
committerEric Lombrozo <elombrozo@gmail.com>2014-02-10 21:41:27 +0800
commitf649175f75adfbee509b82bcdd14427588fd829f (patch)
treeeca9b7287d47119a934577f0d8e75181d43c74a2
parent38faf687aee351d5425c9a7f70c36c3fdf121133 (diff)
downloaddexon-solidity-f649175f75adfbee509b82bcdd14427588fd829f.tar.gz
dexon-solidity-f649175f75adfbee509b82bcdd14427588fd829f.tar.zst
dexon-solidity-f649175f75adfbee509b82bcdd14427588fd829f.zip
cmake can now build to linux and windows. Use -DTARGET_PLATFORM=<linux|w64>
-rw-r--r--CMakeLists.txt25
1 files changed, 20 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5581c13..c65b2e2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,26 @@ link_directories(../libethereum)
add_executable(testeth ${SRC_LIST})
-find_package(Threads REQUIRED)
+if (${TARGET_PLATFORM} STREQUAL "w64")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
+ target_link_libraries(testeth gcc)
+ target_link_libraries(testeth gdi32)
+ target_link_libraries(testeth ws2_32)
+ target_link_libraries(testeth mswsock)
+ target_link_libraries(testeth shlwapi)
+ target_link_libraries(testeth iphlpapi)
+ target_link_libraries(testeth cryptopp)
+ target_link_libraries(testeth boost_system-mt-s)
+ target_link_libraries(testeth boost_filesystem-mt-s)
+ target_link_libraries(testeth boost_thread_win32-mt-s)
+ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+else ()
+ target_link_libraries(testeth ${CRYPTOPP_LIBRARIES})
+ target_link_libraries(testeth boost_system)
+ target_link_libraries(testeth boost_filesystem)
+ find_package(Threads REQUIRED)
+ target_link_libraries(testeth ${CMAKE_THREAD_LIBS_INIT})
+endif ()
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include_directories(/usr/local/include)
@@ -17,8 +36,4 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(testeth ethereum)
target_link_libraries(testeth secp256k1)
target_link_libraries(testeth miniupnpc)
-target_link_libraries(testeth ${CRYPTOPP_LIBRARIES})
target_link_libraries(testeth gmp)
-target_link_libraries(testeth boost_system)
-target_link_libraries(testeth boost_filesystem)
-target_link_libraries(testeth ${CMAKE_THREAD_LIBS_INIT})