Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Include header files in projects (#5514)
Browse files Browse the repository at this point in the history
Currently the project files generated by CMake which can be opened in VS don't contain any header files. For the most part intellisense works, but simple Find In Files mostly doesn't and some other navigation in VS is a bit flaky.

This change adds the header files to the projects.

This is Windows only as CMake doesn't generate any project files on Linux/macOS.

Adds header files to the SOURCES list on windows only.
  • Loading branch information
vitek-karas authored Mar 20, 2019
1 parent bc7bcc6 commit e2ead1e
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/corehost/cli/apphost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ set(SOURCES
../fxr/fx_ver.cpp
)

set(HEADERS
../fxr/fx_ver.h
)

include(../exe.cmake)

add_definitions(-DFEATURE_APPHOST=1)
Expand Down
6 changes: 6 additions & 0 deletions src/corehost/cli/comhost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ set(SOURCES
../json/casablanca/src/utilities/asyncrt_utils.cpp
)

set(HEADERS
comhost.h
../fxr/fx_ver.h
../json/casablanca/include/cpprest/json.h
)

if(WIN32)
list(APPEND SOURCES
Exports.def)
Expand Down
13 changes: 12 additions & 1 deletion src/corehost/cli/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ include_directories(${CMAKE_CURRENT_LIST_DIR}/../common)
list(APPEND SOURCES
${CMAKE_CURRENT_LIST_DIR}/../common/trace.cpp
${CMAKE_CURRENT_LIST_DIR}/../common/utils.cpp)


list(APPEND HEADERS
${CMAKE_CURRENT_LIST_DIR}/../common/trace.h
${CMAKE_CURRENT_LIST_DIR}/../common/utils.h
${CMAKE_CURRENT_LIST_DIR}/../common/pal.h)

if(WIN32)
list(APPEND SOURCES
${CMAKE_CURRENT_LIST_DIR}/../common/pal.windows.cpp
${CMAKE_CURRENT_LIST_DIR}/../common/longfile.windows.cpp)
list(APPEND HEADERS
${CMAKE_CURRENT_LIST_DIR}/../common/longfile.h)
else()
list(APPEND SOURCES
${CMAKE_CURRENT_LIST_DIR}/../common/pal.unix.cpp
Expand All @@ -42,6 +49,10 @@ if(WIN32 AND NOT SKIP_VERSIONING)
list(APPEND RESOURCES ${CMAKE_CURRENT_LIST_DIR}/native.rc)
endif()

if(WIN32)
list(APPEND SOURCES ${HEADERS})
endif()

function(set_common_libs TargetType)

# Libraries used for exe projects
Expand Down
8 changes: 7 additions & 1 deletion src/corehost/cli/dotnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
cmake_minimum_required (VERSION 2.6)
project(dotnet)
set(DOTNET_PROJECT_NAME "dotnet")

set(SOURCES
../fxr/fx_ver.cpp)
../fxr/fx_ver.cpp
)

set(HEADERS
../fxr/fx_ver.h
)

if(WIN32)
list(APPEND SOURCES
Expand Down
17 changes: 17 additions & 0 deletions src/corehost/cli/fxr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ set(SOURCES
./sdk_resolver.cpp
)

set(HEADERS
../deps_format.h
../deps_entry.h
../host_startup_info.h
../runtime_config.h
../json/casablanca/include/cpprest/json.h
../fx_definition.h
../fx_reference.h
../version.h
./corehost_init.h
./fx_ver.h
./fx_muxer.h
./framework_info.h
./sdk_info.h
./sdk_resolver.h
)

include(../lib.cmake)

install(TARGETS hostfxr DESTINATION corehost)
Expand Down
17 changes: 17 additions & 0 deletions src/corehost/cli/hostpolicy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ set(SOURCES
../version.cpp
)

set(HEADERS
../runtime_config.h
../json/casablanca/include/cpprest/json.h
../fxr/fx_ver.h
../breadcrumbs.h
../args.h
../hostpolicy_init.h
../host_startup_info.h
../coreclr.h
../deps_resolver.h
../deps_format.h
../deps_entry.h
../fx_definition.h
../fx_reference.h
../version.h
)

include(../lib.cmake)

install(TARGETS hostpolicy DESTINATION corehost)
Expand Down

0 comments on commit e2ead1e

Please sign in to comment.