diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt new file mode 100644 index 0000000000..cc233746b6 --- /dev/null +++ b/extensions/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required (VERSION 3.0) +project (ACE) + +if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) + message(STATUS "No build type selected, default to Debug") + set(CMAKE_BUILD_TYPE "Debug") +endif() + +option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF) +option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON) + + +if(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "-std=c++11 -march=i686 -m32 -O2 -s -fPIC -fpermissive") + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") + set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++") +else() + set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG") +endif() + +file(GLOB_RECURSE ACE_COMMON_SOURCES common/*.h common/*.hpp common/*.c common/*.cpp) +add_library(ace_common STATIC ${ACE_COMMON_SOURCES}) +include_directories(AFTER "common") + +# Add extensions to build here +add_subdirectory(fcs) + +message("Build Type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file diff --git a/extensions/build/.gitignore b/extensions/build/.gitignore new file mode 100644 index 0000000000..44c5ea8fa7 --- /dev/null +++ b/extensions/build/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/extensions/common/ace_common.cpp b/extensions/common/ace_common.cpp new file mode 100644 index 0000000000..6ccd690c3a --- /dev/null +++ b/extensions/common/ace_common.cpp @@ -0,0 +1,4 @@ + +int test(int var) { + return var; +} \ No newline at end of file diff --git a/extensions/common/ace_common.h b/extensions/common/ace_common.h new file mode 100644 index 0000000000..4a8847b209 --- /dev/null +++ b/extensions/common/ace_common.h @@ -0,0 +1,4 @@ +#pragma once + +#include "targetver.h" + diff --git a/extensions/common/targetver.h b/extensions/common/targetver.h new file mode 100644 index 0000000000..781012c18f --- /dev/null +++ b/extensions/common/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include +#else + +#endif \ No newline at end of file diff --git a/extensions/fcs/CMakeLists.txt b/extensions/fcs/CMakeLists.txt new file mode 100644 index 0000000000..25b7746fe0 --- /dev/null +++ b/extensions/fcs/CMakeLists.txt @@ -0,0 +1,11 @@ +set(ACE_EXTENSION_NAME "ace_fcs") + +file(GLOB_RECURSE SOURCES *.h *.hpp *.c *.cpp) +add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES}) +add_dependencies(${ACE_EXTENSION_NAME} ace_common) +SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") + +if(CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) + set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1) +endif() \ No newline at end of file diff --git a/extensions/ace_fcs.cpp b/extensions/fcs/ace_fcs.cpp similarity index 99% rename from extensions/ace_fcs.cpp rename to extensions/fcs/ace_fcs.cpp index 81c515e0aa..bf3b8e1290 100644 --- a/extensions/ace_fcs.cpp +++ b/extensions/fcs/ace_fcs.cpp @@ -11,8 +11,8 @@ * Correction to angle */ -#include "stdafx.h" - +#include "ace_common.h" + #define _USE_MATH_DEFINES #include diff --git a/extensions/stdafx.cpp b/extensions/stdafx.cpp deleted file mode 100644 index e1e622b65d..0000000000 --- a/extensions/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// ace_fcs.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/extensions/stdafx.h b/extensions/stdafx.h deleted file mode 100644 index f3a07375c7..0000000000 --- a/extensions/stdafx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -// Windows Header Files: -#include - - - -// TODO: reference additional headers your program requires here