Support for building Static
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
2e227a2688
commit
517f95bfc5
|
@ -5,7 +5,11 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror")
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
|
||||||
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
|
file(GLOB_RECURSE SRC_FILES "src/*.cpp" "src/*.hpp")
|
||||||
add_library(Arbutils SHARED ${SRC_FILES})
|
if (SHARED)
|
||||||
|
add_library(Arbutils SHARED ${SRC_FILES})
|
||||||
|
else()
|
||||||
|
add_library(Arbutils STATIC ${SRC_FILES})
|
||||||
|
endif(SHARED)
|
||||||
set_target_properties(Arbutils PROPERTIES LINKER_LANGUAGE CXX)
|
set_target_properties(Arbutils PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
|
|
|
@ -19,6 +19,11 @@ class ArbutilsConan(ConanFile):
|
||||||
if self.settings.os == "Windows":
|
if self.settings.os == "Windows":
|
||||||
self.output.warn("Noticed Windows target, setting Cmake WINDOWS=On.")
|
self.output.warn("Noticed Windows target, setting Cmake WINDOWS=On.")
|
||||||
cmake.definitions["WINDOWS"] = "On"
|
cmake.definitions["WINDOWS"] = "On"
|
||||||
|
if self.options["shared"]:
|
||||||
|
self.output.info("Building shared library.")
|
||||||
|
cmake.definitions["SHARED"] = "On"
|
||||||
|
else:
|
||||||
|
self.output.info("Building static library.")
|
||||||
cmake.configure()
|
cmake.configure()
|
||||||
cmake.build()
|
cmake.build()
|
||||||
|
|
||||||
|
@ -30,6 +35,7 @@ class ArbutilsConan(ConanFile):
|
||||||
self.copy("*.hpp", dst="include/Arbutils", src="src")
|
self.copy("*.hpp", dst="include/Arbutils", src="src")
|
||||||
self.copy("*.dll", dst="bin", keep_path=False)
|
self.copy("*.dll", dst="bin", keep_path=False)
|
||||||
self.copy("*.so", dst="lib", keep_path=False)
|
self.copy("*.so", dst="lib", keep_path=False)
|
||||||
|
self.copy("*.a", dst="lib", keep_path=False)
|
||||||
|
|
||||||
def package_info(self):
|
def package_info(self):
|
||||||
self.cpp_info.libs = ["Arbutils"]
|
self.cpp_info.libs = ["Arbutils"]
|
||||||
|
|
Loading…
Reference in New Issue