Skip to content

Commit

Permalink
[WIP] : try to fix compilations on many targets
Browse files Browse the repository at this point in the history
[RMV] : Removal of codeql-analysis.yml
  • Loading branch information
aiekick committed Jun 3, 2024
1 parent 5760d8c commit ce8cc42
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 95 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v1
with:
name: ImCoolBar
path: build/ImCoolBar
name: ImCoolBarApp_Linux_x32
path: bin/ImCoolBarApp_Linux_x32
4 changes: 2 additions & 2 deletions .github/workflows/Osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v1
with:
name: ImCoolBar.app
path: build/ImCoolBar.app
name: ImCoolBarApp_Darwin_x32.app
path: bin/ImCoolBarApp_Darwin_x32.app
4 changes: 2 additions & 2 deletions .github/workflows/Win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
- name: upload artifact
uses: actions/upload-artifact@v1
with:
name: ImCoolBar_App_WIn32
path: build\Release\ImCoolBar_App_WIn32.exe
name: ImCoolBarApp_Windows_x64
path: bin\ImCoolBarApp_Windows_x64.exe
74 changes: 0 additions & 74 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

40 changes: 29 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ include(cmake/3rdparty.cmake)
if(MSVC)
add_definitions(-DMSVC)
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wdeprecated-declarations -Wunused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wpedantic -Wdeprecated-declarations -Wunused-parameter")
endif ()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand All @@ -26,6 +26,25 @@ if (ENABLED_DEBUG)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLE_IMCOOLBAR_DEBUG")
endif()

if ("${CMAKE_EXE_LINKER_FLAGS}" STREQUAL "/machine:x64")
set(ARCH x64)
else()
set(ARCH x32)
endif()

if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX _debug)
endif()
if(NOT CMAKE_RELEASE_POSTFIX)
set(CMAKE_RELEASE_POSTFIX) ## to config in file
endif()
if(NOT CMAKE_MINSIZEREL_POSTFIX)
set(CMAKE_MINSIZEREL_POSTFIX _minsizerel)
endif()
if(NOT CMAKE_RELWITHDEBINFO_POSTFIX)
set(CMAKE_RELWITHDEBINFO_POSTFIX _reldeb)
endif()

set(FINAL_BIN_DIR ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_PDB_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}/debug")
set(CMAKE_PDB_OUTPUT_DIRECTORY_RELEASE "${FINAL_BIN_DIR}/release")
Expand Down Expand Up @@ -83,7 +102,7 @@ if(USE_TEST)
add_subdirectory(${CMAKE_SOURCE_DIR}/tests)
endif()

add_subdirectory(${CMAKE_SOURCE_DIR}/ImCoolbar)
add_subdirectory(${CMAKE_SOURCE_DIR}/ImCoolBar)

add_executable(${PROJECT}
MACOSX_BUNDLE
Expand All @@ -97,19 +116,14 @@ add_executable(${PROJECT}
if (APPLE)
set_target_properties(${PROJECT}
PROPERTIES
OUTPUT_NAME "${PROJECT}_Macos"
MACOSX_BUNDLE_EXECUTABLE_NAME "${PROJECT}"
MACOSX_BUNDLE_EXECUTABLE_NAME "${PROJECT}_${CMAKE_SYSTEM_NAME}_${ARCH}"
MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT}"
FOLDER "${PROJECT}"
##RESOURCE icon.icns
MACOSX_BUNDLE_SHORT_VERSION_STRING ""
MACOSX_BUNDLE_LONG_VERSION_STRING ""
##MACOSX_BUNDLE_ICON_FILE icon.icns
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/MacOSXBundleInfo.plist.in")
elseif(WIN32)
set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}_WIn32")
elseif(UNIX)
set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}_Unix")
endif()

set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -127,12 +141,16 @@ target_link_libraries(${PROJECT} PRIVATE
${IMCOOLBAR_LIBRARIES}
)

set_target_properties(ImCoolbar PROPERTIES FOLDER Lib)
set_target_properties(ImCoolBar PROPERTIES FOLDER Lib)

target_include_directories(ImCoolbar PRIVATE
target_include_directories(ImCoolBar PRIVATE
${CMAKE_SOURCE_DIR}
)

message("Output will be : ${PROJECT}_${CMAKE_SYSTEM_NAME}_${ARCH}")

set_target_properties(${PROJECT} PROPERTIES OUTPUT_NAME "${PROJECT}_${CMAKE_SYSTEM_NAME}_${ARCH}")

set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${FINAL_BIN_DIR}")
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${FINAL_BIN_DIR}")
set_target_properties(${PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${FINAL_BIN_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion ImCoolBar
4 changes: 1 addition & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "3rdparty/imgui/backends/imgui_impl_opengl3.h"
#include "3rdparty/imgui/backends/imgui_impl_glfw.h"
#include <ImCoolbar/ImCoolbar.h>
#include <ImCoolBar/ImCoolBar.h>
#include "CustomFont.cpp"
#include <stdio.h>
#include <sstream>
Expand Down Expand Up @@ -240,8 +240,6 @@ int main(int, char**) {
_appDatas.textures.push_back(std::make_pair(name, loadTexture("res/" + name + ".png")));
}

const char* imCoolBarTitle = "##CoolBarMainWin";

while (!glfwWindowShouldClose(window)) {
glfwPollEvents();

Expand Down

0 comments on commit ce8cc42

Please sign in to comment.