Skip to content

Commit

Permalink
Updated build script
Browse files Browse the repository at this point in the history
  • Loading branch information
vaiorabbit committed Jan 12, 2024
1 parent a26aa2d commit 93273fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions imnodes_dll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ target_sources(ImNodes PUBLIC "${CMAKE_CURRENT_LIST_DIR}/ImNodesCAPI.h")
target_sources(ImNodes PRIVATE "${CMAKE_CURRENT_LIST_DIR}/ImNodesCAPI.cpp")
include_directories( ${CMAKE_CURRENT_LIST_DIR}/../imgui_dll/cimgui/imgui )

target_link_directories(ImNodes PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../lib)

if (APPLE)
target_link_libraries(ImNodes imgui.${CMAKE_OSX_ARCHITECTURES})
target_link_directories(ImNodes PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../imgui_dll/build_${CMAKE_OSX_ARCHITECTURES})
target_link_libraries(ImNodes imgui)
elseif(UNIX)
target_link_directories(ImNodes PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../imgui_dll/build)
if (DEFINED CROSS_BUILD_PLATFORM)
target_link_libraries(ImNodes imgui.${CROSS_BUILD_PLATFORM})
else()
Expand All @@ -22,6 +22,7 @@ else()
# add_library(imgui SHARED IMPORTED)
# set_target_properties(imgui PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../imgui_dll/build)
# set_target_properties(imgui PROPERTIES IMPORTED_IMPLIB ${CMAKE_CURRENT_SOURCE_DIR}/../imgui_dll/build/libimgui.dll)
target_link_directories(ImNodes PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../imgui_dll/build)
target_link_libraries(ImNodes imgui)
endif()

Expand Down
3 changes: 1 addition & 2 deletions imnodes_dll/build_imnodes_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ cd build
cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -D CMAKE_CXX_COMPILER=clang++ ../
make
arch=`uname -m`
mv imnodes.so imnodes.${arch}.so
cp *.so ../../lib
cp imnodes.so ../../lib/imnodes.${arch}.so
3 changes: 1 addition & 2 deletions imnodes_dll/build_imnodes_linux_cross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ export ARCH=aarch64
cmake -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON -D CMAKE_CXX_FLAGS=-isystem\ /usr/aarch64-linux-gnu/include -D CMAKE_BUILD_TYPE=Release -D CMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu -D CMAKE_SYSTEM_PROCESSOR=ARM -D BUILD_SHARED_LIBS=ON -D CROSS_BUILD_PLATFORM=${ARCH} -D CMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ ../
make

mv imnodes.so imnodes.${ARCH}.so
cp *.so ../../lib
cp imnodes.so ../../lib/imnodes.${ARCH}.so

0 comments on commit 93273fe

Please sign in to comment.