diff options
author | Young Jin Kim <youki@microsoft.com> | 2021-02-04 08:04:48 +0300 |
---|---|---|
committer | Martin Junczys-Dowmunt <Marcin.JunczysDowmunt@microsoft.com> | 2021-02-04 08:04:48 +0300 |
commit | b2d2a5d45794de6c0241e61138239473a39819e8 (patch) | |
tree | a506318bd054e721832c55987f02e19e30995ce7 | |
parent | e407d49bda00a4b932e477a8b6d1945d5b9226cd (diff) |
Merged PR 17525: cmake fix for GENERATE_MARIAN_INSTALL_TARGETS
cmake fix for GENERATE_MARIAN_INSTALL_TARGETS
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/3rd_party/CMakeLists.txt | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 149d8a42..14f90ed9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,8 +438,10 @@ endif(USE_MPI) ############################################################################### # Find BLAS library if(COMPILE_CPU) - set(EXT_LIBS ${EXT_LIBS} intgemm) # Enable intgemm when compiling CPU - add_definitions(-DCOMPILE_CPU=1) + if(NOT GENERATE_MARIAN_INSTALL_TARGETS) + set(EXT_LIBS ${EXT_LIBS} intgemm) # Enable intgemm when compiling CPU + add_definitions(-DCOMPILE_CPU=1) + endif() if(USE_APPLE_ACCELERATE) if(NOT APPLE) message(FATAL_ERROR "FATAL ERROR: Apple Accelerate only works on macOS.") diff --git a/src/3rd_party/CMakeLists.txt b/src/3rd_party/CMakeLists.txt index 51c3bbf2..28d84743 100644 --- a/src/3rd_party/CMakeLists.txt +++ b/src/3rd_party/CMakeLists.txt @@ -9,8 +9,10 @@ add_subdirectory(./faiss) include_directories(./faiss) if(COMPILE_CPU) - set(INTGEMM_DONT_BUILD_TESTS ON CACHE BOOL "Disable intgemm tests") - add_subdirectory(./intgemm) + if(NOT GENERATE_MARIAN_INSTALL_TARGETS) + set(INTGEMM_DONT_BUILD_TESTS ON CACHE BOOL "Disable intgemm tests") + add_subdirectory(./intgemm) + endif() endif(COMPILE_CPU) if(USE_FBGEMM) @@ -69,7 +71,9 @@ if(USE_SENTENCEPIECE) endif() # regardless of -DUSE_STATIC_LIBS setting always build sentencepiece statically - set(SPM_ENABLE_SHARED OFF CACHE BOOL "Builds shared libaries in addition to static libraries." FORCE) + if(NOT GENERATE_MARIAN_INSTALL_TARGETS) + set(SPM_ENABLE_SHARED OFF CACHE BOOL "Builds shared libaries in addition to static libraries." FORCE) + endif() set(SPM_ENABLE_TCMALLOC ON CACHE BOOL "Enable TCMalloc if available.") if(USE_STATIC_LIBS) |