Skip to content

Commit a8b163e

Browse files
PatriceJiangminggo
authored andcommitted
[new renderer] add mac&ios cmake support (#342)
* add mac&ios cmake support * remove unused condition
1 parent 3b0d6eb commit a8b163e

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ target_link_libraries(external
4646
ext_md5
4747
)
4848

49+
50+
4951
# use lua/js specific libs by property to prevent conflict
5052
if(BUILD_JS_LIBS)
5153
add_subdirectory(spidermonkey)
@@ -134,3 +136,12 @@ set_target_properties(external
134136
FOLDER "External"
135137
)
136138

139+
140+
if(MACOSX OR IOS)
141+
add_subdirectory(glsl-optimizer)
142+
target_link_libraries(external
143+
ext_glcpp_library
144+
ext_glsl_optimizer
145+
ext_libmesa
146+
)
147+
endif()

glsl-optimizer/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
set(lib_name glsl_optimizer)
4+
set(target_name ext_${lib_name})
5+
6+
project(${lib_name})
7+
8+
include(../cmake/CocosExternalConfig.cmake)
9+
10+
add_library(ext_glcpp_library STATIC IMPORTED GLOBAL)
11+
add_library(ext_glsl_optimizer STATIC IMPORTED GLOBAL)
12+
add_library(ext_libmesa STATIC IMPORTED GLOBAL)
13+
14+
15+
set_target_properties(${target_name} PROPERTIES
16+
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
17+
)
18+
19+
set_target_properties(ext_glcpp_library PROPERTIES
20+
IMPORTED_LOCATION "${platform_spec_path}/libglcpp-library.a"
21+
)
22+
set_target_properties(ext_glsl_optimizer PROPERTIES
23+
IMPORTED_LOCATION "${platform_spec_path}/libglsl_optimizer.a"
24+
)
25+
set_target_properties(ext_libmesa PROPERTIES
26+
IMPORTED_LOCATION "${platform_spec_path}/libmesa.a"
27+
)

0 commit comments

Comments
 (0)