Skip to content

Commit eef64f7

Browse files
committed
Respect CMAKE_BUILD_TYPE as build config for the C# plugin. Further fixes in the build system of the C# plugin.
1 parent a41164e commit eef64f7

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

plugins/csharp/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Set .NET build configuration based on CMAKE_BUILD_TYPE
2+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
3+
set(DOTNET_CONFIG "Debug")
4+
else()
5+
set(DOTNET_CONFIG "Release")
6+
endif()
7+
18
add_subdirectory(parser)
29
add_subdirectory(service)
310

plugins/csharp/parser/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_subdirectory(src_csharp)
2+
23
include_directories(
34
include
45
${PROJECT_SOURCE_DIR}/model/include
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
cmake_minimum_required(VERSION 3.5.1)
2-
project(CodeCompassCSharp)
3-
41
add_custom_target(dotnetbuild ALL
5-
COMMAND dotnet build -o ${CMAKE_CURRENT_BINARY_DIR}/csharp
6-
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
2+
COMMAND dotnet build -c ${DOTNET_CONFIG} -o ${CMAKE_CURRENT_BINARY_DIR}/csharp
3+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
74
)
85

96
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csharp
10-
DESTINATION ${INSTALL_LIB_DIR}
11-
USE_SOURCE_PERMISSIONS)
7+
DESTINATION ${INSTALL_LIB_DIR}
8+
USE_SOURCE_PERMISSIONS
9+
)

plugins/csharp/service/src_csharp/CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
cmake_minimum_required(VERSION 3.5.1)
2-
project(CodeCompassCSharp)
3-
41
add_custom_target(dotnetbuildservice
52
COMMAND ${THRIFT_EXECUTABLE} --gen netstd
63
-o ${CMAKE_CURRENT_BINARY_DIR}
@@ -24,12 +21,13 @@ add_custom_target(dotnetaddthriftlib
2421
add_dependencies(dotnetaddthriftlib dotnetaddclasslib)
2522

2623
add_custom_target(dotnetbuildfiles ALL
27-
COMMAND dotnet build -o ${CMAKE_CURRENT_BINARY_DIR}/csharpservice -p:BuildDir=${CMAKE_CURRENT_BINARY_DIR}
24+
COMMAND dotnet build -c ${DOTNET_CONFIG} -o ${CMAKE_CURRENT_BINARY_DIR}/csharpservice -p:BuildDir=${CMAKE_CURRENT_BINARY_DIR}
2825
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
2926
)
3027

3128
add_dependencies(dotnetbuildfiles dotnetaddthriftlib)
3229

3330
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/csharpservice
34-
DESTINATION ${INSTALL_SERVICE_DIR}
35-
USE_SOURCE_PERMISSIONS)
31+
DESTINATION ${INSTALL_SERVICE_DIR}
32+
USE_SOURCE_PERMISSIONS
33+
)

0 commit comments

Comments
 (0)