✨ vs could build with cmakelists.txt
This commit is contained in:
parent
dfb0c6ab52
commit
7f258dd17e
|
@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
project(nasal VERSION 10.1)
|
project(nasal VERSION 10.1)
|
||||||
|
|
||||||
|
message("CMAKE_HOST_SYSTEM_NAME: ${CMAKE_HOST_SYSTEM_NAME}")
|
||||||
|
|
||||||
# -std=c++14 -Wshadow -Wall
|
# -std=c++14 -Wshadow -Wall
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
@ -24,12 +26,20 @@ add_library(nasock SHARED ${CMAKE_SOURCE_DIR}/module/nasocket.cpp)
|
||||||
target_include_directories(nasock PRIVATE ${CMAKE_SOURCE_DIR})
|
target_include_directories(nasock PRIVATE ${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
add_executable(nasal main.cpp)
|
add_executable(nasal main.cpp)
|
||||||
|
|
||||||
|
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
|
||||||
|
message("Ignore linking dl lib")
|
||||||
|
else()
|
||||||
target_link_libraries(nasal dl)
|
target_link_libraries(nasal dl)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(nasal PRIVATE ${CMAKE_SOURCE_DIR})
|
target_include_directories(nasal PRIVATE ${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
|
if(NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET nasal POST_BUILD
|
TARGET nasal POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
${CMAKE_SOURCE_DIR}/build/nasal
|
${CMAKE_SOURCE_DIR}/build/nasal
|
||||||
${CMAKE_SOURCE_DIR}/nasal
|
${CMAKE_SOURCE_DIR}/nasal
|
||||||
)
|
)
|
||||||
|
endif()
|
|
@ -8,6 +8,9 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#else
|
#else
|
||||||
#pragma warning (disable:4566) // i know i'm using utf-8, fuck you
|
#pragma warning (disable:4566) // i know i'm using utf-8, fuck you
|
||||||
|
#pragma warning (disable:4244)
|
||||||
|
#pragma warning (disable:4267)
|
||||||
|
#pragma warning (disable:4996)
|
||||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning (disable:4244)
|
||||||
|
#pragma warning (disable:4267)
|
||||||
|
#endif
|
||||||
|
|
||||||
class codegen {
|
class codegen {
|
||||||
private:
|
private:
|
||||||
u16 fileindex;
|
u16 fileindex;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning (disable:4244)
|
||||||
|
#pragma warning (disable:4267)
|
||||||
|
#pragma warning (disable:4102)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning (disable:4244)
|
||||||
|
#pragma warning (disable:4267)
|
||||||
|
#pragma warning (disable:4102)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
|
@ -7,6 +7,12 @@
|
||||||
#include "nasal_gc.h"
|
#include "nasal_gc.h"
|
||||||
#include "nasal_codegen.h"
|
#include "nasal_codegen.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning (disable:4244)
|
||||||
|
#pragma warning (disable:4267)
|
||||||
|
#pragma warning (disable:4102)
|
||||||
|
#endif
|
||||||
|
|
||||||
class vm {
|
class vm {
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue