endif()
endif()
+set(CMAKE_MACOSX_RPATH ON)
+
###########################################################
# Convenience macros
###########################################################
set(OPENGL_DIR ${SOURCE_DIR}/OpenGL)
set(OPENGL_COMPILER_DIR ${OPENGL_DIR}/compiler)
set(LLVM_DIR ${CMAKE_SOURCE_DIR}/third_party/LLVM)
-set(SUBZERO_DIR ${CMAKE_SOURCE_DIR}/third_party/pnacl-subzero)
+set(SUBZERO_DIR ${CMAKE_SOURCE_DIR}/third_party/subzero)
set(SUBZERO_LLVM_DIR ${CMAKE_SOURCE_DIR}/third_party/llvm-subzero)
set(TESTS_DIR ${CMAKE_SOURCE_DIR}/tests)
set(HELLO2_DIR ${CMAKE_SOURCE_DIR}/third_party/PowerVR_SDK/Examples/Beginner/01_HelloAPI/OGLES2)
else()
set_cpp_flag("--std=c++11")
set_cpp_flag("-Wall")
- set_cpp_flag("-fexceptions")
+ set_cpp_flag("-fno-exceptions")
# Don't allow symbols to be overridden by another module.
# This enables libGLES_CM and libGLESv2 to statically link LLVM.
set_cpp_flag("-s" RELEASE)
# For distribution it is more important to be slim than super optimized
- # so even in Release we use only -O2
- set_cpp_flag("-O2 -Os" RELEASE)
- set_cpp_flag("-O2 -Os" RELWITHDEBINFO)
+ set_cpp_flag("-Os" RELEASE)
+ set_cpp_flag("-Os" RELWITHDEBINFO)
set_cpp_flag("-DNDEBUG" RELEASE)
set_cpp_flag("-DNDEBUG" RELWITHDEBINFO)
${LLVM_DIR}/lib/Support/raw_os_ostream.cpp
${LLVM_DIR}/lib/Support/raw_ostream.cpp
${LLVM_DIR}/lib/Support/system_error.cpp
- ${LLVM_DIR}/lib/TableGen/Error.cpp
- ${LLVM_DIR}/lib/TableGen/Main.cpp
- ${LLVM_DIR}/lib/TableGen/Record.cpp
- ${LLVM_DIR}/lib/TableGen/TGLexer.cpp
- ${LLVM_DIR}/lib/TableGen/TGParser.cpp
- ${LLVM_DIR}/lib/TableGen/TableGenBackend.cpp
${LLVM_DIR}/lib/Target/Mangler.cpp
${LLVM_DIR}/lib/Target/TargetData.cpp
${LLVM_DIR}/lib/Target/TargetELFWriterInfo.cpp
${SUBZERO_DIR}/
${SUBZERO_LLVM_DIR}/include/
${SUBZERO_DIR}/pnacl-llvm/include/
- ${SOURCE_DIR}/Reactor/SubmoduleCheck/
)
if(WIN32)
${OPENGL_DIR}/common/debug.h
${CMAKE_SOURCE_DIR}/include/*.h
)
-# Key method definitions are only required to appease the gold linker,
-# and cause vtable linking issues with other linkers.
-list(REMOVE_ITEM EGL_LIST ${OPENGL_DIR}/libEGL/TypeInfo.cpp)
file(GLOB_RECURSE GL32_LIST
${OPENGL_DIR}/libGL/*.cpp
${CMAKE_SOURCE_DIR}/include/GLES2/*.h
${CMAKE_SOURCE_DIR}/include/GLES3/*.h
)
-# Key method definitions are only required to appease the gold linker,
-# and cause vtable linking issues with other linkers.
-list(REMOVE_ITEM GLES2_LIST ${OPENGL_DIR}/libGLESv2/TypeInfo.cpp)
file(GLOB_RECURSE GLES_CM_LIST
${OPENGL_DIR}/libGLES_CM/*.cpp
INCLUDE_DIRECTORIES "${COMMON_INCLUDE_DIR}"
POSITION_INDEPENDENT_CODE 1
FOLDER "Core"
+ COMPILE_DEFINITIONS "NO_SANITIZE_FUNCTION=;"
)
target_link_libraries(SwiftShader ${OS_LIBS})
set_target_properties(libEGL PROPERTIES
INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
FOLDER "OpenGL"
- COMPILE_DEFINITIONS "EGL_EGLEXT_PROTOTYPES; EGLAPI=;"
+ COMPILE_DEFINITIONS "EGL_EGLEXT_PROTOTYPES; EGLAPI=; NO_SANITIZE_FUNCTION=;"
PREFIX ""
)
set_target_export_map(libEGL ${SOURCE_DIR}/OpenGL/libEGL)
set_target_properties(libGLESv2 PROPERTIES
INCLUDE_DIRECTORIES "${OPENGL_INCLUDE_DIR}"
FOLDER "OpenGL"
- COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES; GL_API=; GL_APICALL=;"
+ COMPILE_DEFINITIONS "GL_GLEXT_PROTOTYPES; GL_API=; GL_APICALL=; NO_SANITIZE_FUNCTION=;"
PREFIX ""
)
set_target_export_map(libGLESv2 ${SOURCE_DIR}/OpenGL/libGLESv2)