Several fixes for new build, ensuring we build DLLs for Windows, and that the proper libraries are included.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2020-07-11 13:46:48 +02:00
parent 69bf782c4c
commit f873dc97bf
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 8 additions and 2 deletions

View File

@ -31,6 +31,7 @@ steps:
image: deukhoofd/windowsbuilder
commands:
- cmake -DCMAKE_BUILD_TYPE=Release . -B build-release-windows -D CMAKE_C_COMPILER=/home/wclang/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-clang -D CMAKE_CXX_COMPILER=/home/wclang/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-clang++ -DWINDOWS=ON -DSTATICC=ON
- sed -i 's/-fPIC//g' build-release-windows/CMakeFiles/Arbutils.dir/flags.make
- cmake --build build-release-windows --target all -- -j 4
- mv build-release-windows/ArbutilsTests build-release-windows/ArbutilsTests.exe
- export WINEARCH=win64

View File

@ -18,11 +18,16 @@ add_library(Arbutils ${LIBTYPE} ${SRC_FILES})
if (WINDOWS)
MESSAGE(WARNING, "Using Windows Build.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -Wa,-mbig-obj -pthread -wc-use-mingw-linker")
set_target_properties(Arbutils PROPERTIES SUFFIX ".dll")
endif (WINDOWS)
if (STATICC)
target_link_libraries(Arbutils -static)
if (WINDOWS)
target_link_libraries(Arbutils -wc-static-runtime)
else ()
target_link_libraries(Arbutils -static-libgcc -static-libstdc++)
endif (WINDOWS)
endif (STATICC)
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")