Skip to content

Commit

Permalink
cmake: use 'target_precompile_headers'
Browse files Browse the repository at this point in the history
Fix also ninja build issue
  • Loading branch information
fabienfl-orc committed Nov 9, 2020
1 parent 4576245 commit d31e841
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cmake/Orc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ add_compile_options(
/Qpar # Enable Parallel Code Generation
# /Qspectre- # No need of mitigation as MS disable theirs when as administrator
/sdl # Enable additional security checks
/Yustdafx.h
# /Zi # Program database for edit and continue (debug only)
/bigobj
)
Expand Down Expand Up @@ -71,7 +70,4 @@ foreach(OPTION IN ITEMS ${COMPILE_OPTIONS_RELEASE})
add_compile_options($<$<CONFIG:RELWITHDEBINFO>:${OPTION}>)
endforeach()

# Always add precompiled header creation flag
set_source_files_properties(stdafx.cpp PROPERTIES COMPILE_FLAGS "/Ycstdafx.h")

endmacro()
2 changes: 2 additions & 0 deletions src/FastFind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ set_target_properties(FastFind
LINK_FLAGS "/DEBUG /MANIFESTUAC:\"level='requireAdministrator'\""
)

target_precompile_headers(FastFind PRIVATE stdafx.h)

if("${CMAKE_GENERATOR_TOOLSET}" STREQUAL "v141_xp"
AND "${TARGET_ARCH}" STREQUAL "x86")

Expand Down
2 changes: 2 additions & 0 deletions src/Orc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ target_link_libraries(Orc
VisualStudio::atls
)

target_precompile_headers(Orc PRIVATE stdafx.h)

if("${CMAKE_GENERATOR_TOOLSET}" STREQUAL "v141_xp"
AND "${TARGET_ARCH}" STREQUAL "x86")

Expand Down
2 changes: 2 additions & 0 deletions src/OrcApacheOrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ set_target_properties(OrcApacheOrc
FOLDER "${ORC_ROOT_VIRTUAL_FOLDER}OrcApacheOrc"
)

target_precompile_headers(OrcApacheOrc PRIVATE stdafx.h)

foreach(CONFIG Debug MinSizeRel Release RelWithDebInfo)
install(TARGETS OrcApacheOrc
CONFIGURATIONS ${CONFIG}
Expand Down
2 changes: 2 additions & 0 deletions src/OrcApacheOrcLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ add_library(OrcApacheOrcLib
${SRC_COMMON}
)

target_precompile_headers(OrcApacheOrcLib PRIVATE stdafx.h)

target_include_directories(OrcApacheOrcLib
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
Expand Down
2 changes: 2 additions & 0 deletions src/OrcCommand/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,6 @@ target_include_directories(OrcCommand

target_link_libraries(OrcCommand PUBLIC OrcLib)

target_precompile_headers(OrcCommand PRIVATE stdafx.h)

set_target_properties(OrcCommand PROPERTIES FOLDER "${ORC_ROOT_VIRTUAL_FOLDER}")
1 change: 1 addition & 0 deletions src/OrcLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -796,5 +796,6 @@ endif()
target_link_libraries(OrcLib PUBLIC chakracore::chakracore-header-only)
endif()

target_precompile_headers(OrcLib PRIVATE stdafx.h)

set_target_properties(OrcLib PROPERTIES FOLDER "${ORC_ROOT_VIRTUAL_FOLDER}")
2 changes: 2 additions & 0 deletions src/OrcParquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ set_target_properties(OrcParquet
FOLDER "${ORC_ROOT_VIRTUAL_FOLDER}OrcParquet"
)

target_precompile_headers(OrcParquet PRIVATE stdafx.h)

foreach(CONFIG Debug MinSizeRel Release RelWithDebInfo)
install(TARGETS OrcParquet
CONFIGURATIONS ${CONFIG}
Expand Down
2 changes: 2 additions & 0 deletions src/OrcParquetLib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ add_library(OrcParquetLib
${SRC_COMMON}
)

target_precompile_headers(OrcParquetLib PRIVATE stdafx.h)

target_compile_definitions(OrcParquetLib PUBLIC ARROW_STATIC PARQUET_STATIC)

target_include_directories(OrcParquetLib PRIVATE ${Boost_INCLUDE_DIRS})
Expand Down
2 changes: 2 additions & 0 deletions src/OrcSql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ add_library(OrcSql
${SRC_UTILITIES}
)

target_precompile_headers(OrcSql PRIVATE stdafx.h)

target_include_directories(OrcSql
PRIVATE
${Boost_INCLUDE_DIRS}
Expand Down
2 changes: 2 additions & 0 deletions tests/OrcApacheOrcTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ set_target_properties(OrcApacheOrcTest
FOLDER "${ORC_ROOT_VIRTUAL_FOLDER}OrcApacheOrc"
)

target_precompile_headers(OrcApacheOrcTest PRIVATE stdafx.h)

if("${TARGET_ARCH}" STREQUAL "x64")
set(APACHEORC_VAR_NAME "APACHEORC_X64DLL")
elseif("${TARGET_ARCH}" STREQUAL "x86")
Expand Down
2 changes: 2 additions & 0 deletions tests/OrcLibTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ target_link_libraries(OrcLibTest
OrcLib
)

target_precompile_headers(OrcLibTest PRIVATE stdafx.h)

set_target_properties(OrcLibTest PROPERTIES FOLDER "${ORC_ROOT_VIRTUAL_FOLDER}")

if(ORC_BUILD_CHAKRACORE)
Expand Down
2 changes: 2 additions & 0 deletions tests/OrcSqlTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ add_library(OrcSqlTest
${SRC_COMMON}
)

target_precompile_headers(OrcSqlTest PRIVATE stdafx.h)

target_link_libraries(OrcSqlTest PRIVATE OrcSql)

set_target_properties(OrcSqlTest
Expand Down

0 comments on commit d31e841

Please sign in to comment.