-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from mVento3/cmake
CMake support
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is not used for compiling but used | ||
# when generating project using CMake generator. | ||
# If you are not using CMake then just open .sln file | ||
|
||
cmake_minimum_required(VERSION 3.22) | ||
|
||
project(CppAst.NET CSharp) | ||
|
||
set(CMAKE_CSharp_FLAGS "${CMAKE_CSharp_FLAGS} /langversion:latest") | ||
|
||
set(CMAKE_DOTNET_TARGET_FRAMEWORK net8.0) | ||
set(CMAKE_DOTNET_SDK "Microsoft.NET.Sdk") | ||
|
||
add_subdirectory(src) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
add_subdirectory(CppAst) | ||
add_subdirectory(CppAst.Tests) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
file(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cs) | ||
|
||
add_library(CppAst.Tests SHARED ${SOURCE_FILES}) | ||
|
||
set_target_properties(CppAst.Tests PROPERTIES | ||
VS_PACKAGE_REFERENCES "Microsoft.NET.Test.Sdk_17.8.0;nunit_4.0.1;NUnit3TestAdapter_4.5.0" | ||
) | ||
|
||
target_compile_options(CppAst.Tests PUBLIC "/unsafe") | ||
target_link_libraries(CppAst.Tests CppAst) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
file(GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cs) | ||
|
||
set(CMAKE_CSharp_FLAGS "${CMAKE_CSharp_FLAGS} /langversion:7.3") | ||
|
||
add_library(CppAst SHARED ${SOURCE_FILES}) | ||
|
||
set_target_properties(CppAst PROPERTIES | ||
VS_PACKAGE_REFERENCES "ClangSharp_17.0.1;Irony_1.2.0" | ||
) | ||
|
||
target_compile_options(CppAst PUBLIC "/unsafe") |