summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2018-01-07 12:51:26 +0000
committerCarlos Martín Nieto <cmn@dwim.me>2018-01-07 12:51:26 +0000
commit85e40bbf0938cac5668e810864f6be9619b9e60e (patch)
treeecf6b5de73555009de61099ddf62760657993326
parenteebc5e0d72c86634e6cd6fcc1306c309c02f87af (diff)
downloadlibgit2-cmn/static-archive-later.tar.gz
cmake: move the rule to find static archives close to building clarcmn/static-archive-later
If we're building static libraries, we want to use that for building our clar binary. This is done in 49551254 (2017-09-22; cmake: use static dependencies when building static libgit2) but that commit included the rule too early, making it affect the search for iconv, meaning we did not find it when we were building a static libgit2. Move the rule to just before building clar, after we've included the rules for building the library itself. This lets us find and link to the dynamic libiconv.
-rw-r--r--CMakeLists.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bedf85819..e6ba74934 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -222,10 +222,6 @@ IF (MSVC)
SET(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO}")
SET(CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}")
ELSE ()
- IF (NOT BUILD_SHARED_LIBS)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
- ENDIF()
-
IF (ENABLE_REPRODUCIBLE_BUILDS)
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Dqc <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> Dq <TARGET> <LINK_FLAGS> <OBJECTS>")
@@ -304,6 +300,12 @@ ENDIF()
ADD_SUBDIRECTORY(src)
# Tests
+IF (NOT MSVC)
+ IF (NOT BUILD_SHARED_LIBS)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
+ ENDIF()
+ENDIF ()
+
IF (BUILD_CLAR)
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests)