mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
d99e85ea4b
JSAPI functions are not extern "C" anymore. This warning has a couple false positives due to template specialization (see first patch of this bug), but we were already working around them, because apparently some mingw builds use it. Once I fix cbindgen to generate the specializations as needed we can remove those workarounds, but this is green in the meantime and doesn't hurt. Depends on D61626 Differential Revision: https://phabricator.services.mozilla.com/D61627 --HG-- extra : moz-landing-system : lando
36 lines
928 B
CMake
36 lines
928 B
CMake
project(rust-mozjs)
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
set(DUMMY ${CMAKE_BUILD_TYPE})
|
|
|
|
set(SOURCES
|
|
src/jsglue.cpp
|
|
)
|
|
|
|
include_directories($ENV{DEP_MOZJS_OUTDIR}/dist/include)
|
|
|
|
if(MSVC)
|
|
if(NOT "$ENV{CARGO_FEATURE_DEBUGMOZJS}" STREQUAL "")
|
|
add_definitions(-MDd -Od -DDEBUG -D_DEBUG)
|
|
else()
|
|
add_definitions(-MD)
|
|
endif()
|
|
add_definitions(-FI$ENV{DEP_MOZJS_OUTDIR}/js/src/js-confdefs.h)
|
|
add_definitions(-DWIN32)
|
|
add_definitions(-Zi -GR-)
|
|
else()
|
|
if(NOT "$ENV{CARGO_FEATURE_DEBUGMOZJS}" STREQUAL "")
|
|
add_definitions(-g -O0 -DDEBUG -D_DEBUG)
|
|
endif()
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
add_definitions(-Wno-c++0x-extensions -Wno-invalid-offsetof)
|
|
endif()
|
|
add_definitions(-fPIC -fno-rtti)
|
|
add_definitions(-std=gnu++17)
|
|
add_definitions(-include $ENV{DEP_MOZJS_OUTDIR}/js/src/js-confdefs.h)
|
|
endif()
|
|
|
|
add_library(jsglue STATIC ${SOURCES})
|
|
install(TARGETS jsglue ARCHIVE DESTINATION lib)
|
|
|