Skip to content

Commit

Permalink
updates to cmake build for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfriend99 committed Sep 19, 2024
1 parent dd730e6 commit b9617ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Compile
run: |
sudo apt-get update
sudo apt-get install curl libcurl4-openssl-dev -y
sudo apt-get install curl libcurl4-openssl-dev libgd-dev -y
cmake -B .
cmake --build . -- -j 12
chmod +x blade/blade
Expand All @@ -53,6 +53,7 @@ jobs:
- uses: actions/checkout@v4
- name: Compile
run: |
brew install gd
cmake -B . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl
cmake --build . -- -j 12
chmod 755 blade/blade
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
run: |
${{ env.VCPKG_ROOT }}/vcpkg update
${{ env.VCPKG_ROOT }}/vcpkg version
${{ env.VCPKG_ROOT }}/vcpkg install curl:x64-windows libffi:x64-windows openssl:x64-windows libpng:x64-windows libjpeg-turbo:x64-windows
${{ env.VCPKG_ROOT }}/vcpkg install curl:x64-windows libffi:x64-windows openssl:x64-windows libpng:x64-windows libjpeg-turbo:x64-windows libgd:x64-windows
${{ env.VCPKG_ROOT }}/vcpkg list
- name: Save vcpkg dependencies cache
id: vcpkg-cache-save
Expand Down
18 changes: 3 additions & 15 deletions packages/imagine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,10 @@ add_library(imagine SHARED imagine.c)
target_link_libraries(imagine libblade)
add_dependencies(imagine blade)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_FIND_FRAMEWORK LAST)
set(ENABLE_CPP OFF CACHE INTERNAL "Disabled CPP")
set(ENABLE_PNG ON CACHE INTERNAL "Enabled PNG")
set(ENABLE_JPEG ON CACHE INTERNAL "Enabled JPEG")
set(BUILD_TEST OFF CACHE INTERNAL "Disabled building tests")
include(FetchContent)
FetchContent_Declare(LibGD
URL https://github.com/blade-lang/libgd/archive/refs/heads/master.zip
URL_HASH SHA256=9f79756057ecff898c1e33749245435cdfd6121e8ec1e1140b00de531010e825
)
FetchContent_MakeAvailable(LibGD)

target_include_directories(imagine PRIVATE "${libgd_SOURCE_DIR}/src")
target_link_libraries(imagine gd_static)
include(FindGD.cmake)
target_include_directories(imagine PRIVATE ${GD_INCLUDE_DIR})
target_link_libraries(imagine ${GD_LIBRARIES})

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
Expand Down

0 comments on commit b9617ed

Please sign in to comment.