aboutsummaryrefslogtreecommitdiff
This patch allows the build process to use the provided dependencies instead
of adding their source as CMake sub-directories (in which case "make install"
would install googletest's and googlebenchmark's libraries and headers).

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e7d127..4b269b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ MACRO(FP16_TARGET_ENABLE_CXX11 target)
 ENDMACRO()
 
 # ---[ Download deps
-IF(NOT DEFINED PSIMD_SOURCE_DIR)
+IF(FALSE)
   MESSAGE(STATUS "Downloading PSimd to ${CMAKE_BINARY_DIR}/psimd-source (define PSIMD_SOURCE_DIR to avoid it)")
   CONFIGURE_FILE(cmake/DownloadPSimd.cmake "${CMAKE_BINARY_DIR}/psimd-download/CMakeLists.txt")
   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -38,7 +38,7 @@ IF(NOT DEFINED PSIMD_SOURCE_DIR)
   SET(PSIMD_SOURCE_DIR "${CMAKE_BINARY_DIR}/psimd-source" CACHE STRING "PSimd source directory")
 ENDIF()
 
-IF(FP16_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
+IF(FALSE)
   MESSAGE(STATUS "Downloading Google Test to ${CMAKE_BINARY_DIR}/googletest-source (define GOOGLETEST_SOURCE_DIR to avoid it)")
   CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CMAKE_BINARY_DIR}/googletest-download/CMakeLists.txt")
   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -48,7 +48,7 @@ IF(FP16_BUILD_TESTS AND NOT DEFINED GOOGLETEST_SOURCE_DIR)
   SET(GOOGLETEST_SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-source" CACHE STRING "Google Test source directory")
 ENDIF()
 
-IF(FP16_BUILD_BENCHMARKS AND NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR)
+IF(FALSE)
   MESSAGE(STATUS "Downloading Google Benchmark to ${CMAKE_BINARY_DIR}/googlebenchmark-source (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)")
   CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CMAKE_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt")
   EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
@@ -84,22 +84,7 @@ INSTALL(FILES
     include/fp16/avx2.py
   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fp16)
 
-# ---[ Configure psimd
-IF(NOT TARGET psimd)
-  ADD_SUBDIRECTORY(
-    "${PSIMD_SOURCE_DIR}"
-    "${CMAKE_BINARY_DIR}/psimd")
-ENDIF()
-
 IF(FP16_BUILD_TESTS)
-  # ---[ Build google test
-  IF(NOT TARGET gtest)
-    SET(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-    ADD_SUBDIRECTORY(
-      "${GOOGLETEST_SOURCE_DIR}"
-      "${CMAKE_BINARY_DIR}/googletest")
-  ENDIF()
-
   # ---[ Build FP16 unit tests
   ADD_EXECUTABLE(ieee-to-fp32-bits-test test/ieee-to-fp32-bits.cc test/tables.cc)
   TARGET_INCLUDE_DIRECTORIES(ieee-to-fp32-bits-test PRIVATE test)
@@ -137,40 +122,32 @@ IF(FP16_BUILD_TESTS)
 ENDIF()
 
 IF(FP16_BUILD_BENCHMARKS)
-  # ---[ Build google benchmark
-  IF(NOT TARGET benchmark)
-    SET(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "")
-    ADD_SUBDIRECTORY(
-      "${GOOGLEBENCHMARK_SOURCE_DIR}"
-      "${CMAKE_BINARY_DIR}/googlebenchmark")
-  ENDIF()
-
   # ---[ Build FP16 benchmarks
   ADD_EXECUTABLE(ieee-element-bench bench/ieee-element.cc)
   TARGET_COMPILE_DEFINITIONS(ieee-element-bench PRIVATE FP16_COMPARATIVE_BENCHMARKS=1)
   TARGET_INCLUDE_DIRECTORIES(ieee-element-bench PRIVATE ${PROJECT_SOURCE_DIR})
-  TARGET_LINK_LIBRARIES(ieee-element-bench fp16 psimd benchmark)
+  TARGET_LINK_LIBRARIES(ieee-element-bench fp16 benchmark)
 
   ADD_EXECUTABLE(alt-element-bench bench/alt-element.cc)
-  TARGET_LINK_LIBRARIES(alt-element-bench fp16 psimd benchmark)
+  TARGET_LINK_LIBRARIES(alt-element-bench fp16 benchmark)
 
   ADD_EXECUTABLE(from-ieee-array-bench bench/from-ieee-array.cc)
   FP16_TARGET_ENABLE_CXX11(from-ieee-array-bench)
   TARGET_COMPILE_DEFINITIONS(from-ieee-array-bench PRIVATE FP16_COMPARATIVE_BENCHMARKS=1)
   TARGET_INCLUDE_DIRECTORIES(from-ieee-array-bench PRIVATE ${PROJECT_SOURCE_DIR})
-  TARGET_LINK_LIBRARIES(from-ieee-array-bench fp16 psimd benchmark)
+  TARGET_LINK_LIBRARIES(from-ieee-array-bench fp16 benchmark)
 
   ADD_EXECUTABLE(from-alt-array-bench bench/from-alt-array.cc)
   FP16_TARGET_ENABLE_CXX11(from-alt-array-bench)
-  TARGET_LINK_LIBRARIES(from-alt-array-bench fp16 psimd benchmark)
+  TARGET_LINK_LIBRARIES(from-alt-array-bench fp16 benchmark)
 
   ADD_EXECUTABLE(to-ieee-array-bench bench/to-ieee-array.cc)
   FP16_TARGET_ENABLE_CXX11(to-ieee-array-bench)
   TARGET_COMPILE_DEFINITIONS(to-ieee-array-bench PRIVATE FP16_COMPARATIVE_BENCHMARKS=1)
   TARGET_INCLUDE_DIRECTORIES(to-ieee-array-bench PRIVATE ${PROJECT_SOURCE_DIR})
-  TARGET_LINK_LIBRARIES(to-ieee-array-bench fp16 psimd benchmark)
+  TARGET_LINK_LIBRARIES(to-ieee-array-bench fp16 benchmark)
 
   ADD_EXECUTABLE(to-alt-array-bench bench/to-alt-array.cc)
   FP16_TARGET_ENABLE_CXX11(to-alt-array-bench)
-  TARGET_LINK_LIBRARIES(to-alt-array-bench fp16 psimd benchmark)
+  TARGET_LINK_LIBRARIES(to-alt-array-bench fp16 benchmark)
 ENDIF()
nu/packages/lisp-xyz.scm (sbcl-virality): Update to 0.3.0-1.cdc19cc. [arguments]: Update 'delete-examples' phase. Guillaume Le Vaillant 2023-09-04gnu: cl-gobject-introspection: Update to 0.3-3.83beec4....* gnu/packages/lisp-xyz.scm (sbcl-cl-gobject-introspection): Update to 0.3-3.83beec4. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-09-04gnu: cl-cl+ssl: Update to 0.0.0-6.17d5cdd....* gnu/packages/lisp-xyz.scm (sbcl-cl+ssl): Update to 0.0.0-6.17d5cdd. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-09-04gnu: cl-iolib: Update to 0.8.4-0.010b7a6....* gnu/packages/lisp-xyz.scm (sbcl-iolib): Update to 0.8.4.0.010b7a6. [native-inputs]: Add pkg-config and sbcl-fiveam. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-09-02gnu: sbcl-njson: Update to 1.1.1....* gnu/packages/lisp-xyz.scm (sbcl-json): Update to 1.1.1. [description]: Update description. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Artyom Bologov 2023-09-13gnu: cl-nasdf: Update to 0.1.8....* gnu/packages/lisp-xyz.scm (sbcl-nasdf): Update to 0.1.8. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-09-13gnu: cl-njson: Update to 1.2.0....* gnu/packages/lisp-xyz.scm (sbcl-njson): Update to 1.2.0. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Artyom Bologov 2023-08-22gnu: cl-trivial-clipboard: Update to 0.0.0-6.6ddf8d5....* gnu/packages/lisp-xyz.scm (sbcl-trivial-clipboard): Update to 0.0.0-6.6ddf8d5. [inputs]: Add wl-clipboard. [arguments]: Update 'fix-paths' phase. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-08-18gnu: Add cl-gtk4....* gnu/packages/lisp-xyz.scm (sbcl-cl-gtk4, cl-gtk4, ecl-cl-gtk4): New variables. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> ykonai 2023-08-18gnu: Add cl-glib....* gnu/packages/lisp-xyz.scm (sbcl-cl-glib, cl-glib, ecl-cl-glib): New variables. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> ykonai 2023-08-18gnu: Add cl-gobject-introspection-wrapper....* gnu/packages/lisp-xyz.scm (sbcl-cl-gobject-introspection-wrapper, cl-gobject-introspection-wrapper, ecl-cl-gobject-introspection-wrapper): New variables. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> ykonai 2023-08-18gnu: cl-gobject-introspection: Update to 0.3-2.c4fef07....* gnu/packages/lisp-xyz.scm (sbcl-cl-gobject-introspection): Update to 0.3-2.c4fef07. [inputs]: Remove labels. Co-authored-by: Guillaume Le Vaillant <glv@posteo.net> ykonai 2023-08-18gnu: cl-nasdf: Update to 0.1.7....* gnu/packages/lisp-xyz.scm (sbcl-nasdf): Update to 0.1.7. [arguments]: Remove trailing boolean. Co-authored-by: Artyom Bologov <mail@aartaka.me> Guillaume Le Vaillant 2023-08-10gnu: cl-mime: Fix home page URL....* gnu/packages/lisp-xyz.scm (sbcl-cl-mime)[home-page]: Use the correct URL. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Konrad Hinsen 2023-08-08gnu: cl-nodgui: Remove input labels....* gnu/packages/lisp-xyz.scm (sbcl-nodgui)[inputs]: Remove labels. [arguments]: Use gexp. Guillaume Le Vaillant 2023-08-08gnu: cl-nodgui: Update to 0.4.8.5-2.4a9c2e7....* gnu/packages/lisp-xyz.scm (sbcl-nodgui): Update to 0.4.8.5-2.4a9c2e7. [source, home-page]: Switch from Notabug to Codeberg. [inputs]: Remove sbcl-cl-lex and sbcl-cl-yacc. Add sbcl-esrap and tklib. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> cage 2023-08-08gnu: cl-colors2: Update to 0.5.4-4.7a14107....* gnu/packages/lisp-xyz.scm (sbcl-cl-colors2): Update to 0.5.4-4.7a14107. [source, home-page]: Switch from Notabug to Codeberg. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> cage 2023-08-08gnu: cl-i18n: Update to 0.5.5-3.acb162a....* gnu/packages/lisp-xyz.scm (sbcl-cl-i18n): Update to 0.5.5-3.acb162a. [source, home-page]: Switch from Notabug to Codeberg. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> cage 2023-08-08gnu: cl-tooter: Update to 1.0.0-4.2e1b22f05....* gnu/packages/lisp-xyz.scm (sbcl-tooter): Update to 1.0.0-4.2e1b22f05. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> cage 2023-08-02gnu: Add cl-transmission....* gnu/packages/lisp-xyz.scm (cl-transmission, ecl-transmission, sbcl-transmission): New variables. Pierre Neidhardt 2023-07-25gnu: cl-nasdf: Update to 0.1.6....* gnu/packages/lisp-xyz.scm (sbcl-nasdf): Update to 0.1.6. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-07-24gnu: cl-ironclad: Update to 0.59....* gnu/packages/lisp-xyz.scm (sbcl-ironclad): Update to 0.59. Guillaume Le Vaillant 2023-07-19gnu: cl-usocket: Update to 0.8.6....* gnu/packages/lisp-xyz.scm (sbcl-usocket): Update to 0.8.6. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-07-19gnu: cl-ndebug: Update to 0.2.0....* gnu/packages/lisp-xyz.scm (sbcl-ndebug): Update to 0.2.0. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-07-19gnu: cl-array-utils: Update to 1.2.0-0.29da8fc....* gnu/packages/lisp-xyz.scm (sbcl-array-utils): Update to 1.2.0-0.29da8fc. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> Andre A. Gomes 2023-07-15gnu: cl-nhooks: Update to 1.2.1....* gnu/packages/lisp-xyz.scm (sbcl-nhooks): Update to 1.2.1. [native-inputs]: Remove sbcl-fiveam, add sbcl-lisp-unit2. Co-authored-by: Guillaume Le Vaillant <glv@posteo.net> Artyom Bologov