Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add cmake build #222

Merged
merged 3 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ jobs:
- name: make
run: make EXTRA_CFLAGS=-Werror CCACHE=

- name: cmake
if: ${{ runner.os == 'Linux' }}
run: make cmake

- name: cmake
if: ${{ runner.os == 'macOS' }}
run: |
OPENSSL_ROOT_DIR=/usr/local/opt/openssl cmake -B build && cmake --build build -j

- uses: sreimers/[email protected]
with:
name: rem
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ add_library(re OBJECT ${SRCS})
set_target_properties(re PROPERTIES POSITION_INDEPENDENT_CODE ON)

target_include_directories(re PRIVATE .)
target_include_directories(re PRIVATE include)
target_include_directories(re PRIVATE include ${OPENSSL_INCLUDE_DIR})


##############################################################################
Expand All @@ -430,7 +430,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
)
endif()
target_link_libraries(re-shared
PRIVATE -L/opt/local/lib -lssl -lcrypto -lpthread)
PRIVATE -L/opt/local/lib ${OPENSSL_LIBRARIES} -lpthread)


if(WIN32)
Expand Down Expand Up @@ -463,7 +463,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
)
endif()
target_link_libraries(re-static
PUBLIC -lssl -lcrypto -lpthread
PUBLIC ${OPENSSL_LIBRARIES} -lpthread
PRIVATE -L/opt/local/lib
)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ $(BUILD): Makefile $(MK) $(MODMKS)
.PHONY: clean
clean:
$(HIDE)rm -rf $(SHARED) $(STATIC) libre.pc test.d test.o test \
$(BUILD) .cache/re
build $(BUILD) .cache/re
$(HIDE)rm -f compile_commands.json


Expand Down
9 changes: 9 additions & 0 deletions mk/re.mk
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,15 @@ info::
@echo " BIN_SUFFIX: $(BIN_SUFFIX)"


.PHONY: cmake
cmake:
cmake -B build && cmake --build build --parallel


.PHONY: ninja
ninja:
cmake -B build -G Ninja && cmake --build build

##############################################################################
#
# Packaging section
Expand Down