4
0
mirror of https://github.com/QuasarApp/zip.git synced 2025-05-03 15:49:33 +00:00

CMake3.4 -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE ()

Co-authored-by: kuba-- <>
This commit is contained in:
Kuba Podgórski 2020-04-20 23:15:55 +02:00 committed by GitHub
parent f053be982f
commit e6c9807d8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 8 deletions

@ -7,10 +7,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Tools
run: sudo apt-get -y install tree
- name: Configure
run: cmake -DSANITIZE_ADDRESS=On .
- name: Build
run: cmake --build .
run: |
cmake --build .
tree -sha .
- name: Test
run: ASAN_OPTIONS=detect_leaks=0 LSAN_OPTIONS=verbosity=1:log_threads=1 ctest -VV
@ -18,12 +22,16 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Tools
run: brew install tree
- name: Configure
run: |
pip3 install scan-build
scan-build cmake -DSANITIZE_ADDRESS=On .
- name: Build
run: scan-build -v --exclude test -enable-checker security.FloatLoopCounter -enable-checker security.insecureAPI.UncheckedReturn --status-bugs cmake --build .
run: |
scan-build -v --exclude test -enable-checker security.FloatLoopCounter -enable-checker security.insecureAPI.UncheckedReturn --status-bugs cmake --build .
tree -sha .
- name: Test
run: ctest -VV
@ -33,8 +41,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Configure
run: cmake .
run: cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE .
- name: Build
run: cmake --build . --config "Debug"
run: |
cmake --build . --config "Debug"
tree /a /f .
- name: Test
run: ctest -VV -C "Debug"
run: ctest -VV -C "Debug"

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.4)
project(zip
LANGUAGES C
@ -20,7 +20,21 @@ endif (MSVC)
# zip
set(SRC src/miniz.h src/zip.h src/zip.c)
add_library(${PROJECT_NAME} ${SRC})
# this is the "object library" target: compiles the sources only once
add_library(OBJLIB OBJECT ${SRC})
# shared libraries need PIC
set_property(TARGET OBJLIB PROPERTY POSITION_INDEPENDENT_CODE 1)
# static and shared libraries built from the same object files
if (BUILD_SHARED_LIBS)
add_library(${PROJECT_NAME} SHARED $<TARGET_OBJECTS:OBJLIB>)
include(GenerateExportHeader)
generate_export_header(${PROJECT_NAME})
else()
add_library(${PROJECT_NAME} STATIC $<TARGET_OBJECTS:OBJLIB>)
endif()
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.4)
# test
set(test_out test.out)