aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2019-04-18 19:39:36 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2019-04-24 16:12:10 +0800
commit08cf676887a35ff6335d042278c4dd0bba0778e1 (patch)
treef21e5179666e9408ef164dd222ba55062c8e0dd5
parent0a327d8c1bd2fd8082029a3553b527af898121d3 (diff)
downloadtangerine-mcl-08cf676887a35ff6335d042278c4dd0bba0778e1.tar.gz
tangerine-mcl-08cf676887a35ff6335d042278c4dd0bba0778e1.tar.zst
tangerine-mcl-08cf676887a35ff6335d042278c4dd0bba0778e1.zip
[cmake] add NOT_ONLY_LIB
-rw-r--r--CMakeLists.txt31
-rw-r--r--Makefile2
2 files changed, 20 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a8f7a2..bc91a81 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -37,6 +37,11 @@ option(
"use base64.ll with -DCMAKE_CXX_COMPILER=clang++"
OFF
)
+option(
+ ONLY_LIB
+ "only lib"
+ OFF
+)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -188,15 +193,17 @@ install(FILES ${MCL_HEADERS} DESTINATION include/mcl)
install(FILES include/mcl/impl/bn_c_impl.hpp DESTINATION include/mcl/impl)
install(FILES ${CYBOZULIB_HEADERS} DESTINATION include/cybozu)
-set(TEST_BASE fp_test ec_test fp_util_test window_method_test elgamal_test fp_tower_test gmp_test bn_test glv_test)
-#set(TEST_BASE bn_test)
-foreach(base IN ITEMS ${TEST_BASE})
- add_executable(
- ${base}
- test/${base}.cpp
- )
- target_link_libraries(
- ${base}
- ${LIBS}
- )
-endforeach()
+if(NOT ONLY_LIB)
+ set(TEST_BASE fp_test ec_test fp_util_test window_method_test elgamal_test fp_tower_test gmp_test bn_test glv_test)
+ #set(TEST_BASE bn_test)
+ foreach(base IN ITEMS ${TEST_BASE})
+ add_executable(
+ ${base}
+ test/${base}.cpp
+ )
+ target_link_libraries(
+ ${base}
+ ${LIBS}
+ )
+ endforeach()
+endif()
diff --git a/Makefile b/Makefile
index 7df1dd3..c124150 100644
--- a/Makefile
+++ b/Makefile
@@ -352,7 +352,7 @@ update_cybozulib:
cp -a $(addprefix ../cybozulib/,$(wildcard include/cybozu/*.hpp)) include/cybozu/
clean:
- $(RM) $(LIB_DIR)/*.a $(LIB_DIR)/*.$(LIB_SUF) $(OBJ_DIR)/*.o $(OBJ_DIR)/*.obj $(OBJ_DIR)/*.d $(EXE_DIR)/*.exe $(GEN_EXE) $(ASM_OBJ) $(LIB_OBJ) $(BN256_OBJ) $(BN384_OBJ) $(BN512_OBJ) $(LLVM_SRC) $(FUNC_LIST) src/*.ll lib/*.a
+ $(RM) $(LIB_DIR)/*.a $(LIB_DIR)/*.$(LIB_SUF) $(OBJ_DIR)/*.o $(OBJ_DIR)/*.obj $(OBJ_DIR)/*.d $(EXE_DIR)/*.exe $(GEN_EXE) $(ASM_OBJ) $(LIB_OBJ) $(BN256_OBJ) $(BN384_OBJ) $(BN512_OBJ) $(FUNC_LIST) src/*.ll lib/*.a
ALL_SRC=$(SRC_SRC) $(TEST_SRC) $(SAMPLE_SRC)
DEPEND_FILE=$(addprefix $(OBJ_DIR)/, $(addsuffix .d,$(basename $(ALL_SRC))))