Set shared library if so requested.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-07-31 17:38:28 +02:00
parent f6a958b85a
commit 4c48085840
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 11 additions and 3 deletions

View File

@ -79,12 +79,17 @@ if (SCRIPT_PROVIDER STREQUAL "angelscript")
SET(_TESTLINKS angelscript ${_TESTLINKS}) SET(_TESTLINKS angelscript ${_TESTLINKS})
endif () endif ()
# If we are building for Windows we need to set some specific variables.
if (WINDOWS) if (WINDOWS)
message(STATUS "Using Windows build.") MESSAGE(WARNING, "Using Windows Build.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L ${CMAKE_BINARY_DIR}/bin") # Add a definition for the compiler, so we can use it in C++ as well.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -Wl,-allow-multiple-definition") ADD_DEFINITIONS(-D WINDOWS=1)
# -m64: Build a 64 bit library
add_compile_options(-m64)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-allow-multiple-definition")
endif (WINDOWS) endif (WINDOWS)
if (STATICC) if (STATICC)
message(STATUS "Linking C library statically") message(STATUS "Linking C library statically")
SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++) SET(_LINKS ${_LINKS} -static-libgcc -static-libstdc++)

View File

@ -20,6 +20,9 @@ class PkmnLibConan(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"
if self.options.staticC: if self.options.staticC:
cmake.definitions["STATICC"] = "On" cmake.definitions["STATICC"] = "On"
cmake.configure() cmake.configure()