[cmake] fix symbol exporting issue on newer gcc (#724)
This commit is contained in:
parent
8b60e7c2c3
commit
3d61576606
|
@ -269,7 +269,7 @@ if (HB_HAVE_FREETYPE)
|
||||||
|
|
||||||
list(APPEND THIRD_PARTY_LIBS ${FREETYPE_LIBRARIES})
|
list(APPEND THIRD_PARTY_LIBS ${FREETYPE_LIBRARIES})
|
||||||
include_directories(AFTER ${FREETYPE_INCLUDE_DIRS})
|
include_directories(AFTER ${FREETYPE_INCLUDE_DIRS})
|
||||||
add_definitions(-DHAVE_FREETYPE=1 -DHAVE_FT_FACE_GETCHARVARIANTINDEX=1)
|
add_definitions(-DHAVE_FREETYPE=1)
|
||||||
|
|
||||||
list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
|
list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
|
||||||
list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
|
list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
|
||||||
|
@ -530,7 +530,8 @@ if (UNIX OR MINGW)
|
||||||
))
|
))
|
||||||
set (CMAKE_CXX_FLAGS "-fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
|
set (CMAKE_CXX_FLAGS "-fno-rtti -fno-exceptions ${CMAKE_CXX_FLAGS}")
|
||||||
endif ()
|
endif ()
|
||||||
set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
|
add_definitions(-D__CORRECT_ISO_CPP11_MATH_H_PROTO_FP)
|
||||||
|
set (CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c;m") # libc and libm
|
||||||
set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
|
set (CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "")
|
||||||
set_target_properties(harfbuzz PROPERTIES LINKER_LANGUAGE C)
|
set_target_properties(harfbuzz PROPERTIES LINKER_LANGUAGE C)
|
||||||
|
|
||||||
|
@ -790,6 +791,7 @@ endif ()
|
||||||
## Tests
|
## Tests
|
||||||
if (UNIX OR MINGW)
|
if (UNIX OR MINGW)
|
||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
|
# generate harfbuzz.def after build completion
|
||||||
string(REPLACE ";" " " space_separated_headers "${project_headers}")
|
string(REPLACE ";" " " space_separated_headers "${project_headers}")
|
||||||
add_custom_command(TARGET harfbuzz POST_BUILD
|
add_custom_command(TARGET harfbuzz POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E env "headers=${space_separated_headers}" python ${PROJECT_SOURCE_DIR}/src/gen-def.py ${PROJECT_BINARY_DIR}/harfbuzz.def
|
COMMAND ${CMAKE_COMMAND} -E env "headers=${space_separated_headers}" python ${PROJECT_SOURCE_DIR}/src/gen-def.py ${PROJECT_BINARY_DIR}/harfbuzz.def
|
||||||
|
@ -800,13 +802,11 @@ if (UNIX OR MINGW)
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/harfbuzz.dir/src # ugly hack
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/harfbuzz.dir/src # ugly hack
|
||||||
)
|
)
|
||||||
add_test(NAME check-libstdc++.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-libstdc++.sh)
|
add_test(NAME check-libstdc++.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-libstdc++.sh)
|
||||||
set_tests_properties(check-static-inits.sh check-libstdc++.sh PROPERTIES ENVIRONMENT "libs=.;srcdir=${PROJECT_SOURCE_DIR}/src")
|
add_test(NAME check-symbols.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-symbols.sh)
|
||||||
|
add_test(NAME check-defs.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-defs.sh)
|
||||||
|
|
||||||
if (APPLE) # doesn't work on Linux it seems
|
set_tests_properties(check-static-inits.sh check-libstdc++.sh check-symbols.sh check-defs.sh
|
||||||
add_test(NAME check-symbols.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-symbols.sh)
|
PROPERTIES ENVIRONMENT "libs=.;srcdir=${PROJECT_SOURCE_DIR}/src")
|
||||||
add_test(NAME check-defs.sh COMMAND ${PROJECT_SOURCE_DIR}/src/check-defs.sh)
|
|
||||||
set_tests_properties(check-symbols.sh check-defs.sh PROPERTIES ENVIRONMENT "libs=.;srcdir=${PROJECT_SOURCE_DIR}/src")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_test(NAME check-c-linkage-decls.sh COMMAND ./check-c-linkage-decls.sh)
|
add_test(NAME check-c-linkage-decls.sh COMMAND ./check-c-linkage-decls.sh)
|
||||||
|
|
Loading…
Reference in New Issue