Skip to content

Commit

Permalink
CodeLite now requires CMake 3.16 and later
Browse files Browse the repository at this point in the history
Enable PCH for CMake builds
  • Loading branch information
eranif committed Nov 1, 2021
1 parent 397d881 commit 32496ae
Show file tree
Hide file tree
Showing 66 changed files with 243 additions and 313 deletions.
14 changes: 3 additions & 11 deletions AutoSave/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "AutoSave")
Expand All @@ -26,11 +26,6 @@ add_definitions(-DWXUSINGDLL_CL)
add_definitions(-DWXUSINGDLL_SDK)
add_definitions(-DASTYLE_LIB)

if ( USE_PCH AND NOT MINGW )
add_definitions(-include "${CL_PCH_FILE}")
add_definitions(-Winvalid-pch)
endif()

if (UNIX AND NOT APPLE)
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
Expand All @@ -44,10 +39,7 @@ FILE(GLOB SRCS "*.cpp")

# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
17 changes: 5 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.0)
# 3.16 and later is required so we can build CodeLite with PCH
cmake_minimum_required(VERSION 3.16)

#################################################################################################################################################################
## #
Expand Down Expand Up @@ -39,11 +40,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
## Defaults
#############################################
project( "CodeLite" )
if(APPLE)
execute_process(COMMAND make type=release os=osx clean WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/PCH)
execute_process(COMMAND make type=release os=osx WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/PCH)
endif()


if ( PREFIX ) # Apparently cmake uses $PREFIX internally, so we shouldn't set it ourselves
message("**** Setting -DPREFIX is deprecated. Please use -DCL_PREFIX in future")
Expand Down Expand Up @@ -630,10 +626,6 @@ endif()
###########################################
## Add the folders, the order matters here
###########################################
if ( USE_PCH )
add_subdirectory(PCH)
endif()

if ( APPLE )
add_definitions( -mmacosx-version-min=10.8 )
endif()
Expand All @@ -648,8 +640,10 @@ add_subdirectory(sdk/wxshapeframework)
add_subdirectory(sdk/databaselayer)
add_subdirectory(CodeLite)
add_subdirectory(Plugin)
add_subdirectory(PCH)

if(NOT NO_CORE_PLUGINS)
add_subdirectory(abbreviation)
if(NOT DISABLE_CXX)
add_subdirectory(Gizmos)
add_subdirectory(Debugger)
Expand All @@ -661,9 +655,9 @@ if(NOT NO_CORE_PLUGINS)
add_subdirectory(cscope)
add_subdirectory(EOSWiki)
endif()
add_subdirectory(AutoSave)
add_subdirectory(CodeLiteDiff)
add_subdirectory(git)
add_subdirectory(abbreviation)
add_subdirectory(Outline)
add_subdirectory(CodeFormatter)
add_subdirectory(Copyright)
Expand All @@ -673,7 +667,6 @@ if(NOT NO_CORE_PLUGINS)
add_subdirectory(Subversion2)
add_subdirectory(ZoomNavigator)
add_subdirectory(SpellChecker)
add_subdirectory(AutoSave)
add_subdirectory(Tail)
add_subdirectory(EditorConfigPlugin)
add_subdirectory(PHPLint)
Expand Down
6 changes: 2 additions & 4 deletions CMakePlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#

# Don't support very old versions
cmake_minimum_required(VERSION 3.0)


# Create variable for plugin name
set(PLUGIN_NAME "CMakePlugin")
Expand Down Expand Up @@ -53,9 +53,7 @@ file(GLOB SRCS "*.cpp")
# Define the output - shared library
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Codelite plugins doesn't use the "lib" prefix.
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
4 changes: 2 additions & 2 deletions CallGraph/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "CallGraph")
Expand Down
8 changes: 3 additions & 5 deletions CodeCompletionsTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



project(CxxCCTests)

Expand Down Expand Up @@ -40,9 +40,7 @@ FILE(GLOB SRCS "CCTest/*.cpp")
# Define the output
add_executable(CxxCCTests ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(CxxCCTests REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(CxxCCTests REUSE_FROM abbreviation )

# Remove the "lib" prefix from the plugin name
target_link_libraries(CxxCCTests
Expand Down
4 changes: 2 additions & 2 deletions CodeDesigner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "CodeDesigner")
Expand Down
8 changes: 3 additions & 5 deletions CodeFormatter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "CodeFormatter")
Expand Down Expand Up @@ -41,9 +41,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
11 changes: 2 additions & 9 deletions CodeLite/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)

# Our project is called 'codelite' this is how it will be called in
# visual studio, and in our makefiles.
project(libcodelite)

# It was noticed that when using MinGW gcc it is essential that 'core' is mentioned before 'base'.


# wxWidgets include (this will do all the magic to configure everything)
include( "${wxWidgets_USE_FILE}" )

Expand Down Expand Up @@ -112,9 +106,6 @@ FILE(GLOB SRCS "*.cpp" "../sdk/codelite_indexer/network/*.cpp" "SocketAPI/*.cpp"

# Define the output
add_library(libcodelite SHARED ${SRCS})
if( USE_PCH AND MINGW )
target_precompile_headers(libcodelite PRIVATE "libcodelite_pch.h" )
endif( USE_PCH AND MINGW )
target_link_libraries(libcodelite
${LINKER_OPTIONS}
${wxWidgets_LIBRARIES}
Expand All @@ -134,6 +125,8 @@ if(MINGW)
ARCHIVE_OUTPUT_NAME codelite)
endif()

codelite_add_pch(libcodelite)

if (NOT MINGW)
if(APPLE)
install(TARGETS libcodelite DESTINATION ${CMAKE_BINARY_DIR}/codelite.app/Contents/MacOS/)
Expand Down
6 changes: 2 additions & 4 deletions CodeLiteDiff/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Don't support very old versions
cmake_minimum_required(VERSION 3.0)


# Create variable for plugin name
set(PLUGIN_NAME "CodeLiteDiff")
Expand Down Expand Up @@ -49,9 +49,7 @@ file(GLOB SRCS "*.cpp")
# Define the output - shared library
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Codelite plugins doesn't use the "lib" prefix.
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
4 changes: 2 additions & 2 deletions ContinuousBuild/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "ContinuousBuild")
Expand Down
8 changes: 3 additions & 5 deletions Copyright/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "Copyright")
Expand Down Expand Up @@ -41,9 +41,7 @@ endif()
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
9 changes: 3 additions & 6 deletions CxxParserTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



project(CxxLocalVariables)

Expand Down Expand Up @@ -39,10 +39,7 @@ FILE(GLOB SRCS "*.cpp")

# Define the output
add_executable(CxxLocalVariables ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(CxxLocalVariables REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(CxxLocalVariables REUSE_FROM abbreviation)

# Remove the "lib" prefix from the plugin name
target_link_libraries(CxxLocalVariables
Expand Down
8 changes: 3 additions & 5 deletions DatabaseExplorer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "DatabaseExplorer")
Expand Down Expand Up @@ -81,9 +81,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
8 changes: 3 additions & 5 deletions Debugger/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "DebuggerGDB")
Expand Down Expand Up @@ -40,9 +40,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
8 changes: 3 additions & 5 deletions Docker/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "Docker")
Expand Down Expand Up @@ -45,9 +45,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
8 changes: 3 additions & 5 deletions EOSWiki/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "EOSWiki")
Expand Down Expand Up @@ -45,9 +45,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
2 changes: 1 addition & 1 deletion EOSWiki/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "%CMAKE_MODULE_PATH%")
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

Expand Down
8 changes: 3 additions & 5 deletions EditorConfigPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "EditorConfigPlugin")
Expand Down Expand Up @@ -45,9 +45,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
8 changes: 3 additions & 5 deletions ExternalTools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)



# set the plugin name here
set( PLUGIN_NAME "ExternalTools")
Expand Down Expand Up @@ -40,9 +40,7 @@ FILE(GLOB SRCS "*.cpp")
# Define the output
add_library(${PLUGIN_NAME} SHARED ${SRCS})

if( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH )
endif( USE_PCH AND MINGW )
target_precompile_headers(${PLUGIN_NAME} REUSE_FROM PCH)

# Remove the "lib" prefix from the plugin name
set_target_properties(${PLUGIN_NAME} PROPERTIES PREFIX "")
Expand Down
Loading

0 comments on commit 32496ae

Please sign in to comment.