Created
November 25, 2019 18:19
-
-
Save tombatron/4c5b120cc60d0ba52d0a817b131b7094 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File generated at : 14:25:02, Fri 22 Nov | |
# Converted Project : V8.Net-Proxy-x64.vcxproj | |
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) | |
add_definitions(-D_MSC_PLATFORM_TOOLSET=200) | |
# TODO: Make a variable for holding the path to the V8 source. | |
# installed clang and set it as the default compiler | |
# installed sudo apt-get install libc++-dev | |
include_directories( | |
/home/tom/v8/v8/ | |
/home/tom/v8/v8/include | |
/home/tom/v8/v8/src | |
/home/tom/v8/v8/out.gn/x64.release/obj/third_party/icu | |
/home/tom/v8/v8/out.gn/x64.release/obj/src/inspector | |
/home/tom/v8/v8/out.gn/x64.release/obj | |
/home/tom/v8/v8/out.gn/x64.release/gen | |
) | |
FIND_PACKAGE(PkgConfig) | |
PKG_CHECK_MODULES(GLIB glib-2.0) | |
include_directories(${GLIB_INCLUDE_DIRS}) | |
link_directories(${GLIB_LIBRARY_DIRS}) | |
add_definitions(${GLIB_CFLAGS_OTHER}) | |
add_compile_options("-fms-extensions") | |
##################### Variables ############################ | |
# Change if you want modify path or other values # | |
############################################################ | |
# Project | |
get_filename_component(PROJECT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | |
set(DEPENDENCIES_DIR ${PROJECT_DIR}/dependencies) | |
set(PROJECT_NAME V8.Net) | |
# Outputs | |
set(OUTPUT_DEBUG ../bin/) | |
set(OUTPUT_RELEASE ../bin/) | |
################# CMake Project ############################ | |
# The main options of project # | |
############################################################ | |
project(${PROJECT_NAME} CXX) | |
# Define Release by default. | |
if(NOT CMAKE_BUILD_TYPE) | |
set(CMAKE_BUILD_TYPE "Release") | |
message(STATUS "Build type not specified: Use Release by default.") | |
endif(NOT CMAKE_BUILD_TYPE) | |
############## Artefacts Output ############################ | |
# Defines outputs , depending BUILD TYPE # | |
############################################################ | |
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | |
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_DIR}/${OUTPUT_DEBUG}") | |
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_DIR}/${OUTPUT_DEBUG}") | |
set(CMAKE_EXECUTABLE_OUTPUT_DIRECTORY "${PROJECT_DIR}/${OUTPUT_DEBUG}") | |
else() | |
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_DIR}/${OUTPUT_RELEASE}") | |
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_DIR}/${OUTPUT_RELEASE}") | |
set(CMAKE_EXECUTABLE_OUTPUT_DIRECTORY "${PROJECT_DIR}/${OUTPUT_RELEASE}") | |
endif() | |
# Messages | |
message("${PROJECT_NAME}: MAIN PROJECT: ${CMAKE_PROJECT_NAME}") | |
message("${PROJECT_NAME}: CURR PROJECT: ${CMAKE_CURRENT_SOURCE_DIR}") | |
message("${PROJECT_NAME}: CURR BIN DIR: ${CMAKE_CURRENT_BINARY_DIR}") | |
############### Files & Targets ############################ | |
# Files of project and target to build # | |
############################################################ | |
# Source Files | |
set(SRC_FILES | |
./ContextProxy.cpp | |
./Exports.cpp | |
./FunctionTemplateProxy.cpp | |
./HandleProxy.cpp | |
./ObjectTemplateProxy.cpp | |
./Utilities.cpp | |
./V8EngineProxy.cpp | |
./ValueProxy.cpp | |
) | |
source_group("Sources" FILES ${SRC_FILES}) | |
# Header Files | |
set(HEADERS_FILES | |
Platform.h | |
ProxyTypes.h | |
resource.h | |
) | |
source_group("Headers" FILES ${HEADERS_FILES}) | |
# Add library to build. | |
add_library(${PROJECT_NAME} SHARED | |
${SRC_FILES} ${HEADERS_FILES} | |
) | |
######################### Flags ############################ | |
# Defines Flags for Windows and Linux # | |
############################################################ | |
if(NOT MSVC) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | |
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") | |
endif() | |
endif(NOT MSVC) | |
# Preprocessor definitions | |
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | |
target_compile_definitions(${PROJECT_NAME} PRIVATE | |
-D_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) | |
-D_ITERATOR_DEBUG_LEVEL=0 | |
-DDEBUG | |
) | |
if(MSVC) | |
target_compile_options(${PROJECT_NAME} PRIVATE /W3 /MD /Od /Zi) | |
endif() | |
endif() | |
if(CMAKE_BUILD_TYPE STREQUAL "Release") | |
target_compile_definitions(${PROJECT_NAME} PRIVATE | |
-D_MSC_PLATFORM_TOOLSET=$(PlatformToolsetVersion) | |
) | |
if(MSVC) | |
target_compile_options(${PROJECT_NAME} PRIVATE /W3 /GL /Oi /Gy /Zi) | |
endif() | |
endif() | |
########### Link & Dependencies ############################ | |
# Add project dependencies and Link to project # | |
############################################################ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment