Better handling of static c handling.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
293386ac0d
commit
f65b2f74bd
|
@ -17,7 +17,7 @@ steps:
|
||||||
CXX: /usr/bin/clang++
|
CXX: /usr/bin/clang++
|
||||||
commands:
|
commands:
|
||||||
- conan remote add epsilon-public https://packages.p-epsilon.com/
|
- conan remote add epsilon-public https://packages.p-epsilon.com/
|
||||||
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ . -B build-debug
|
- cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ . -B build-debug -DSTATICC=ON
|
||||||
- cmake --build build-debug --target all -- -j 4
|
- cmake --build build-debug --target all -- -j 4
|
||||||
- build-debug/bin/CreatureLibTests -s --durations yes --use-colour yes
|
- build-debug/bin/CreatureLibTests -s --durations yes --use-colour yes
|
||||||
- name: test-release-linux
|
- name: test-release-linux
|
||||||
|
@ -30,7 +30,7 @@ steps:
|
||||||
CXX: /usr/bin/clang++
|
CXX: /usr/bin/clang++
|
||||||
commands:
|
commands:
|
||||||
- conan remote add epsilon-public https://packages.p-epsilon.com/
|
- conan remote add epsilon-public https://packages.p-epsilon.com/
|
||||||
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ . -B build-release
|
- cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ . -B build-release -DSTATICC=ON
|
||||||
- cmake --build build-release --target all -- -j 4
|
- cmake --build build-release --target all -- -j 4
|
||||||
- build-release/bin/CreatureLibTests -s --durations yes --use-colour yes
|
- build-release/bin/CreatureLibTests -s --durations yes --use-colour yes
|
||||||
- valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no --error-exitcode=1 build-release/bin/CreatureLibTests
|
- valgrind --tool=memcheck --gen-suppressions=all --leak-check=full --leak-resolution=med --track-origins=yes --vgdb=no --error-exitcode=1 build-release/bin/CreatureLibTests
|
||||||
|
|
|
@ -16,12 +16,17 @@ if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
if (NOT MINOR MATCHES 0)
|
if (NOT MINOR MATCHES 0)
|
||||||
SET(VERSION ${VERSION}.${MINOR})
|
SET(VERSION ${VERSION}.${MINOR})
|
||||||
endif ()
|
endif ()
|
||||||
|
set(CONAN_STATIC_C False)
|
||||||
|
if (STATICC)
|
||||||
|
set(CONAN_STATIC_C True)
|
||||||
|
endif (STATICC)
|
||||||
|
|
||||||
if (NOT WINDOWS)
|
if (NOT WINDOWS)
|
||||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
||||||
-s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:shared=True)
|
-s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:shared=True -o *:staticC=${CONAN_STATIC_C})
|
||||||
else ()
|
else ()
|
||||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
||||||
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:shared=True)
|
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:shared=True -o *:staticC=${CONAN_STATIC_C})
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
|
@ -50,6 +55,7 @@ if (WINDOWS)
|
||||||
endif (WINDOWS)
|
endif (WINDOWS)
|
||||||
|
|
||||||
if (STATICC)
|
if (STATICC)
|
||||||
|
message(STATUS "Linking C statically.")
|
||||||
SET(_LIBRARYLINKS ${_LIBRARYLINKS} -static-libgcc -static-libstdc++)
|
SET(_LIBRARYLINKS ${_LIBRARYLINKS} -static-libgcc -static-libstdc++)
|
||||||
SET(_BATTLINGLINKS ${_BATTLINGLINKS} -static-libgcc -static-libstdc++)
|
SET(_BATTLINGLINKS ${_BATTLINGLINKS} -static-libgcc -static-libstdc++)
|
||||||
if (NOT DEFINED CONAN_EXPORTED)
|
if (NOT DEFINED CONAN_EXPORTED)
|
||||||
|
|
11
conanfile.py
11
conanfile.py
|
@ -7,8 +7,8 @@ class CreatureLibConan(ConanFile):
|
||||||
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
|
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
|
||||||
description = "The core implementation for turn based battling using creatures."
|
description = "The core implementation for turn based battling using creatures."
|
||||||
settings = "os", "compiler"
|
settings = "os", "compiler"
|
||||||
options = {"shared": [True, False]}
|
options = {"shared": [True, False], "staticC": [True, False]}
|
||||||
default_options = {"shared": True}
|
default_options = {"shared": True, "staticC": False}
|
||||||
generators = "cmake"
|
generators = "cmake"
|
||||||
exports_sources = "*"
|
exports_sources = "*"
|
||||||
compiler = "clang"
|
compiler = "clang"
|
||||||
|
@ -19,13 +19,12 @@ class CreatureLibConan(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.staticC:
|
||||||
|
self.output.info("Linking C libraries statically")
|
||||||
|
cmake.definitions["STATICC"] = "ON"
|
||||||
cmake.configure()
|
cmake.configure()
|
||||||
cmake.build()
|
cmake.build()
|
||||||
|
|
||||||
# Explicit way:
|
|
||||||
# self.run('cmake "%s/src" %s' % (self.source_folder, cmake.command_line))
|
|
||||||
# self.run("cmake --build . %s" % cmake.build_config)
|
|
||||||
|
|
||||||
def package(self):
|
def package(self):
|
||||||
self.copy("*.hpp", dst="include/CreatureLib", src="src")
|
self.copy("*.hpp", dst="include/CreatureLib", src="src")
|
||||||
self.copy("*.dll", dst="bin", keep_path=False)
|
self.copy("*.dll", dst="bin", keep_path=False)
|
||||||
|
|
Loading…
Reference in New Issue