Skip to content

Commit

Permalink
feat(dom): change cmake dependence
Browse files Browse the repository at this point in the history
  • Loading branch information
ilikethese committed Nov 26, 2021
1 parent ff7f797 commit 2fdc898
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 7 additions & 3 deletions dom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ set(LIB_NAME "dom")

project("dom")

get_filename_component(CORE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../framework/js/core/" REALPATH)
get_filename_component(LAYOUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../layout" REALPATH)
get_filename_component(PROJECT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." REALPATH)
get_filename_component(CORE_DIR "${PROJECT_ROOT_DIR}/framework/js/core/" REALPATH)
get_filename_component(LAYOUT_DIR "${PROJECT_ROOT_DIR}/layout" REALPATH)

add_subdirectory(${LAYOUT_DIR} layout_out)
set(DEPS layout)

message("LAYOUT_DIR: ${LAYOUT_DIR}")
include_directories(${CORE_DIR}/include)
include_directories(${CORE_DIR}/third_party/base/include)
include_directories(${LAYOUT_DIR})
Expand All @@ -14,4 +17,5 @@ file(GLOB_RECURSE SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/**)

set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib/dom)
add_library(${LIB_NAME} STATIC ${SRC_FILES})
target_link_libraries(${LIB_NAME} ${DEPS})
set_property(TARGET ${LIB_NAME} PROPERTY CXX_STANDARD 17)
3 changes: 1 addition & 2 deletions framework/js/android/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ add_definitions("-DANDROID")
# endregion

# region source
file(GLOB_RECURSE LAYOUT_SRC ${LAYOUT_DIR}/engine/*.cpp)
file(GLOB_RECURSE CORE_SRC ${CORE_SRC_DIR}/src/*.cc)
file(GLOB_RECURSE JNI_SRC ${PROJECT_SOURCE_DIR}/src/*.cc)
if (${ENABLE_INSPECTOR} STREQUAL "false")
Expand Down Expand Up @@ -151,7 +150,7 @@ include_directories(${CORE_SRC_DIR}/third_party/base/include)
include_directories(${DOM_SRC_DIR}/include)
include_directories(${LAYOUT_DIR})

add_library(${CMAKE_PROJECT_NAME} SHARED ${CORE_SRC} ${URL_PARSER_SRC} ${JNI_SRC} ${LAYOUT_SRC})
add_library(${CMAKE_PROJECT_NAME} SHARED ${CORE_SRC} ${URL_PARSER_SRC} ${JNI_SRC})
target_link_libraries(${CMAKE_PROJECT_NAME} ${HIPPY_DEPS})
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY CXX_STANDARD 17)

Expand Down
9 changes: 9 additions & 0 deletions layout/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(LIB_NAME "layout")

project("layout")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/engine)
file(GLOB_RECURSE SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/engine/*.cpp)

add_library(${LIB_NAME} STATIC ${SRC_FILES})
set_property(TARGET ${LIB_NAME} PROPERTY CXX_STANDARD 17)

0 comments on commit 2fdc898

Please sign in to comment.