1 set(XSLT_SOURCES 2 libxslt/attributes.c 3 libxslt/documents.c 4 libxslt/extensions.c 5 libxslt/extra.c 6 libxslt/functions.c 7 libxslt/imports.c 8 libxslt/keys.c 9 libxslt/namespaces.c 10 libxslt/numbers.c 11 libxslt/pattern.c 12 libxslt/preproc.c 13 libxslt/security.c 14 libxslt/templates.c 15 libxslt/transform.c 16 libxslt/variables.c 17 libxslt/xslt.c 18 libxslt/xsltlocale.c 19 libxslt/xsltutils.c 20 libxslt/attrvt.c 21 ) 22 23 # XSLT_COMPILE_OPTIONS are taken from Chromium. 24 if (WIN32) 25 set(XSLT_PLATFORM_INCLUDE_DIRECTORY win32) 26 set(XSLT_COMPILE_OPTIONS 27 "/wd4267" # size_t to int. 28 29 # TODO(brucedawson): http://crbug.com/554200 4311 is a VS 30 # 2015 64-bit warning for pointer truncation 31 "/wd4311" 32 ) 33 elseif (APPLE) 34 set(XSLT_PLATFORM_INCLUDE_DIRECTORY mac) 35 set(XSLT_COMPILE_OPTIONS 36 # numbers.c, xsltlocale.c, functions.c 37 "-Wno-unused-parameter" 38 39 # libxslt stores a char[3] in a `const unsigned char*`. 40 "-Wno-pointer-sign" 41 42 # xsltDefaultRegion and xsltCalibrateTimestamps are only 43 # used with certain preprocessor defines set. 44 "-Wno-unused-function" 45 ) 46 elseif (UNIX AND NOT APPLE) 47 set(XSLT_PLATFORM_INCLUDE_DIRECTORY linux) 48 set(XSLT_COMPILE_OPTIONS 49 # TODO: 50 # Following warnings are seen only with GCC 4.9.4. Remove once 51 # we move to latest GCC 52 "-Wno-unused-function" 53 "-Wno-unused-parameter" 54 "-Wno-unused-variable" 55 "-Wno-unused-but-set-variable" 56 "-Wno-suggest-attribute=format" 57 "-Wno-sign-compare" 58 ) 59 endif () 60 61 add_library(XSLTJava STATIC ${XSLT_SOURCES}) 62 63 target_link_libraries(XSLTJava PUBLIC XMLJava) 64 65 target_include_directories(XSLTJava 66 PUBLIC "." 67 PRIVATE "${XSLT_PLATFORM_INCLUDE_DIRECTORY}" 68 ) 69 70 if (XSLT_COMPILE_OPTIONS) 71 target_compile_options(XSLTJava PRIVATE ${XSLT_COMPILE_OPTIONS}) 72 endif () 73 74 target_compile_definitions(XSLTJava PUBLIC "LIBXSLT_STATIC")