You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@milagro.apache.org by km...@apache.org on 2019/08/28 12:55:25 UTC

[incubator-milagro-dta] 01/01: add code to cmake to enable shared build

This is an automated email from the ASF dual-hosted git repository.

kmccusker pushed a commit to branch update-cmake
in repository https://gitbox.apache.org/repos/asf/incubator-milagro-dta.git

commit 7d7782a83bf9f16ddb80b98f4fa51cdeeeb5cc6c
Author: Kealan McCusker <ke...@gmail.com>
AuthorDate: Wed Aug 28 13:55:10 2019 +0100

    add code to cmake to enable shared build
---
 libs/crypto/libpqnist/CMakeLists.txt | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libs/crypto/libpqnist/CMakeLists.txt b/libs/crypto/libpqnist/CMakeLists.txt
index de2ed4e..7b4177a 100644
--- a/libs/crypto/libpqnist/CMakeLists.txt
+++ b/libs/crypto/libpqnist/CMakeLists.txt
@@ -57,9 +57,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
         message(STATUS "GCC 4.8 required to run address sanitizer - please upgrade your installation")
     endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
 
-    set(CMAKE_C_FLAGS_RELEASE     " -static -O2")
-    set(CMAKE_C_FLAGS_DEBUG       " -static -O0 -g3 -D DEBUG")
-    set(CMAKE_C_FLAGS_COVERAGE    " -static -O0 -g3 --coverage")
+    IF (BUILD_SHARED_LIBS)
+        set(CMAKE_C_FLAGS_RELEASE     "-O2")
+        set(CMAKE_C_FLAGS_DEBUG       "-O0 -g3 -D DEBUG")
+        set(CMAKE_C_FLAGS_COVERAGE    "-O0 -g3 --coverage")
+    else(BUILD_SHARED_LIBS)
+        set(CMAKE_C_FLAGS_RELEASE     "-static -O2")
+        set(CMAKE_C_FLAGS_DEBUG       "-static -O0 -g3 -D DEBUG")
+        set(CMAKE_C_FLAGS_COVERAGE    "-static -O0 -g3 --coverage")
+    endif(BUILD_SHARED_LIBS)    
+
 endif(CMAKE_COMPILER_IS_GNUCC)
 
 if(CMAKE_BUILD_TYPE STREQUAL "Coverage")